Part Number Hot Search : 
FG4103 F9530 02M92VCA N5415 AM500 TGA4953 2500ET IE1203S
Product Description
Full Text Search
 

To Download MC2GH512NMCA-2SA00 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  multimediacard tm 1 sep.22.2005 revision 0.3 samsung multimediacard product datasheet version 0.3 september 2005 information in this document is provided in relation to samsung products, and is subject to change without notice. nothing in this document shall be construed as granting any license, express or implied, by estoppel or otherwise, to any intellectual property rights in samsung products or technology. all information in this document is provided on as "as is" basis without guarantee or warranty of any kind. 1. for updates or additional information about samsu ng products, contact your nearest samsung office. 2. samsung products are not intended for use in life suppor t, critical care, medical, safety equipment, or similar applications where product failure couldresult in loss of li fe or personal or physical harm, or any military or defense application, or any governmental procurement to which special terms or provisions may apply.
multimediacard tm 2 sep.22.2005 revision 0.3 document title samsung multimediacard revision history the attached data sheets are prepared and approved by samsu ng electronics. and samsung electronics has the right to change all the specifications in data sheet s. samsung electronics will evaluate and reply to any dear customer?s requests and questions on the parameters of this device. if dear customer has any questions, please ca ll or fax to memory product planning t eam, or contact the samsung branch office near your office revision no 0.0 0.1 0.2 0.3 history - initial issue - changed model number (page 5,6) - mmcmobile and mmcplus definitions were introduced. a minimum performance definition was introduced. (page 56,57) - added new item to spec_vers register (page 25) - added new item to csd_stru cture register (page 25,35) - added new item to extended csd revision register (page 35) - added min_performance register to ext_csd regiser (page 32,33) - added 1gb standard-size high speed multimediacard - added 512mb dual voltage reduced-size high speed multime- diacard - contens of memory array partioning were clarified (page 8) - several typos were corrected throughout the book - added 2gb standard-size high speed multimediacard and 1gb dual voltage reduced-size high speed multimediacard date dec. 6. 2004 feb. 22. 2005 mar. 29. 2005 july. 21. 2005 sep. 22. 2005 remark draft 6 draft 7 preliminary
multimediacard tm 3 sep.22.2005 revision 0.3 1. ordering information. ....................................................................................................... .......................... 2. product line-up............................................................................................................. ............................ 3. introduction 3.1 general description................................................................................................... ......................... 3.2 system features....................................................................................................... .......................... 3.3 flash independent techno logy............ .............. .............. .............. .............. ........... ........... ................. 3.4 defect and error management........................................................................................... ................. 3.5 endurance............................................................................................................. ............................. 3.6 automatic sleep mode.................................................................................................. ...................... 3.7 hot insertion......................................................................................................... ............................... 3.8 multimediacard mode................................................................................................... ...................... 3.9 spi mode.............................................................................................................. ............................... 4. product specifications 4.1 reliability and durability............................................................................................ .......................... 4.2 mechanical design and fo rmat............ .............. .............. .............. .............. ........... ........... ................. 5. interface description 5.1 physical description.................................................................................................. .......................... 5.2 multimediacard bus topol ogy............. .............. .............. .............. .............. ............ .......... .................. 5.3 spi bus topology...................................................................................................... .......................... 5.4 electrical interface.................................................................................................. ............................ 5.5 multimediacard registers.............................................................................................. ..................... 6. multimediacard protocol description 6.1 card identification mode...................... ........................................................................ ....................... 6.2 data transfer mode.................................................................................................... ........................ 6.3 clock control......................................................................................................... ............................. 6.4 cyclic redundancy codes ............. .............. .............. .............. .............. .............. ............ ................... 6.5 error conditions...................................................................................................... ............................ 6.6 minimum performance................................................................................................... ..................... 6.7 command............................................................................................................... ............................ 6.8 card state transition................................................................................................. ......................... 6.9 responses............................................................................................................. ............................. 6.10 card status........................................................................................................... ............................. 6.11 memory array partioning.................... ........................................................................... ..................... 6.12 timing diagrams....................................................................................................... ......................... 6.13 data read............................................................................................................. ............................ 6.14 data write............................................................................................................ .............................. 6.15 bus test procedure timing............................................................................................. ................... 6.16 timing values......................................................................................................... ............................ 7. spi mode 7.1 spi interface concept................................................................................................. ........................ 7.2 spi bus topology...................................................................................................... .......................... 7.3 card registers in spi mode....... .............................................................................................. ........... 7.4 spi bus protocol...................................................................................................... ........................... 7.5 mode selection........................................................................................................ ........................... table of contents 5 5 6 6 7 7 7 7 7 8 10 11 12 15 16 17 18 23 39 42 54 54 56 56 58 65 66 68 70 72 74 75 77 78 79 79 80 81 81
multimediacard tm 4 sep.22.2005 revision 0.3 7.6 bus transfer protection........................ ........................................................................ ....................... 7.7 data read.............................................................................................................. ............................. 7.8 data write............................................................................................................. .............................. 7.9 erase and write protect management..................................................................................... ........... 7.10 read csd/cid registers................................................................................................ .................. 7.11 reset sequence........................................................................................................ ........................ 7.12 clock control......................................................................................................... ............................ 7.13 error conditions...................................................................................................... .......................... 7.14 read ahead in multiple block operation................................................................................ ........... 7.15 memory array partioning..................... .......................................................................... .................... 7.16 card lock/unlock operation.................... ........................................................................ ................. 7.17 spi command set....................................................................................................... ...................... 7.18 responses................. .............. .............. .............. .............. .............. ............ .......... ........................... 7.19 data tokens........................................................................................................... ........................... 7.20 data token error...................................................................................................... ......................... 7.21 clearing status bits.................................................................................................. ......................... 7.22 card registers........................................................................................................ .......................... 7.23 spi bus timing diagrams............................................................................................... ................... 7.24 timing values......................................................................................................... ........................... 7.25 spi electrical interface.................... .......................................................................... ......................... 7.26 spi bus operating coditions........................................................................................... .................. 7.27 spi bus timing........................................................................................................ .......................... 82 82 84 85 86 86 86 87 88 88 88 88 92 95 95 96 98 98 102 102 102 102
multimediacard tm 5 sep.22.2005 revision 0.3 1. ordering information 1. module: m 2. card: c 3~4. flash density 64 : 64m 28 : 128m 56 : 256m 12 : 512m 5d : 512m ddp 1g : 1g 1d : 1g ddp 2g : 2g 2d : 2g ddp 4d : 4g ddp 4q : 4g qdp 8q : 8g qdp 5. feature h : high speeed multimediacard 6~8. card density 008 : 8m byte 016 : 16m byte 032 : 32m byte 048 : 48m byte 064 : 64m byte 096 : 96m byte 128 : 128m byte 192 : 192m byte 256 : 256m byte 384 : 384m byte 512 : 512m byte 01g : 1g byte 02g : 2g byte 04g : 4g byte 08g : 8g byte 9. card type n : standard-size multimediacard h : reduced-size multimediacard d : dual voltage reduced-size multimediacard 10. component generation m : 1st generation a : 2nd generation b : 3rd generation c : 4th generation d : 5th generation 11. flash package c : chip y : tsop1 v : wsop b : tbga 12. pcb revision a : none b : 1st rev. c : 2nd rev . 13. " - " 14. packing type 0 : bulk type i 1 : bulk type ii (by white case) 2 : bulk type i (no label) 3 : bulk type ii (no label) 4 : bulk type i (only back label) 5 : bulk type ii (only back label) 15. controller s : s3f49sax 16. controller firmware revision a : none b : 1st rev . c : 2nd rev . d : 3rd rev . e : 4th rev . 17 ~ 18. customer grade " customer list reference " 2. product line-up m c x x x x x x x x x x - x x x x x 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 model number capacities remarks mc12h064nbca-2sa00 64mb standard-size high speed multimediacard mc1gh128naca-2sa00 128mb mc2gh256nmca-2sa00 256mb MC2GH512NMCA-2SA00 512mb mc4gh01gnmca-2sa00 1gb mc4gh02gnmca-2sa00 2gb
multimediacard tm 6 sep.22.2005 revision 0.3 3. introduction 3.1 general description the samsung multimediacard is a universal low cost data st orage and communication media. it is designed to cover a wied area of applications as smart phones, cameras, organizer s, pdas, digital recorders, mp 3 players, pagers, electronic toys, etc. targeted features are high mobility and high performance at a low cost price. it might also be expressed in terms of low power consumption and high data th roughput at the memory card interface. the multimedaicard communication is based on an advanced 13-pin bus. the communication protocol is defined as a part of this standard and referred to as multimediacard mode. for compatibility to existing co ntrollers the cards may offer, in addition to the multimediacard mode , an alternate communication protocol which is based on the spi standard. the samsung multimediacard is very small, removable flas h storage devices, designed specifically for storage applica- tions that put a premium on small form factor, low power and lo w cost. flash is the ideal storage medium for portable, bat- tery-powered devices. it features low power consumption an d is non-volatile, requiring no power to maintain the stored data. it also has a wide operating range for temperature, shock and vibration. 3.2 system features ? multimediacard system specif ication ver. 4.1 compatible ? full backward compatibil ty with previous multimediacard system ( 1bit data bus, multi-card systems) ? supports spi mode ( single and multiple block read and write operations ) ? maximum data rate with up to 52mb/sec interface speed ( using 8 parallel data lines ) ? voltage range : ? card supported clock frequencies 0~20mhz, 0~26mhz, 0~52mhz ? card support for three different data bu s width modes: 1bit(default), 4bit and 8 bit ? two form factors: normal size(24mm x 32mm x 1.4mm) and reduced size (24mm x 18mm x 1.4mm) ? correction of me mory field errors ? simple erase mechanism ? passward protection of cards high voltage multimediacard dual voltage multimediacard communication 2.7 - 3.6 1.65 - 1.95, 2.7 - 3.6 a memory access 2.7 - 3.6 1 .65 - 1.95, 2.7 - 3.6 model number capacities remarks mc12h064dbca-2sa00 64mb dual voltage reduced-size high speed multimediacard mc1gh128daca-2sa00 128mb mc1gh256daca-2sa00 256mb mc2gh512dmca-2sa00 512mb mc2gh01gdmca-2sa00 1gb
multimediacard tm 7 sep.22.2005 revision 0.3 the 512 byte sector size of t he samsung multimediacard is the same as that in an ide magnetic disk drive. to write or read a sector (or multiple sectors), the ho st computer software simply issues a read or write command to the multimedia card. this command contains the address and the number of se ctors to write/read. the host software then waits for the command to complete. the host software does not get involv ed in the details of how the flash memory is erased, pro- grammed or read. this is extremely impo rtant as flash devices are expected to get more and more complex in the future. because the multimediacard uses an intelligent on-board cont roller, the host system software will not require changing as new flash memory evolves. in other words, systems that suppo rt the multimeidacard today will be able to access future multimediacards built with new fl ash technology without having to update or change host software. 3.4 defect and error management the samsung multimediacards contain a sophisticated defect and error m anagement system. this system is analo- gous to the systems found in magnetic disk drives and in ma ny cases offers enhancements. for instance, disk drives do not typically perform a read after write to confirm the data is written correctly because of the performance penalty that would be incurred. multimediacards do a read after write under margin conditions to verify that the data is written cor- rectly (except in the case fo a write without erase command). in the rare case that a bit is found to be defective. multime- diacards will even replace the entire sector with a spare se ctor. this is completely transparent to the host and does not consume any user data space. the multimediacards soft error rate specification is much better than the magnetic disk drive specification. in the extremely rare case a read error does occur, multimediacards have innovative algorithms to recover the data. this is sim- ilar to using retries on a disk drive but is much more sophisti cated. the last line of defense is to employ powerful ecc to correct the data. if ecc is used to recover data, defective bits are replaced with spare bits to ensure they do not cause any future problems. these defect and error management syst ems coupled with the solid-state construction give multimediacards unparal- leled reliability. 3.5 endurance 3.6 automatic sleep mode multimediacards have an endurance specification for each sector of 100,000 writes (reading a lo gical sector is unlimited). this is far beyond what is needed in nearly all applications of multimediacards. even very heavy use fo the multimedi- acard in celluar phone, personal communicators, pagers and voice recorders will use only a fraction of the total endur- ance over the typical device?s five year lifetime. for instance, it would take ov er 100 years to wear out an area on the multimediacard on which a files of any size (from 512bytes to capacity) was rewritten 3 times per hour, 8 hours a day, 365 days per year. with typical applications the endurance limit is not of any practical concern to the vast majority of users. an important feature of the multimediacard is automatic ent rance and exit from sleep mode. upon completion of an oper- ation, the multimediacard will enter the sleep mode to conserve power if no further commands are received within 5 msec. the host does not have to take any action for this to o ccur. in most systems, the mu ltimediacard is in sleep mode except when the host is acccessing it, thus conserving power . when the host is ready to access the multimediacard and it is in sleep moed, any command issued to the multimediaca rd will cause it to exit slee p and respond. the host does not have to issue a reset first. it may do this if desired, but it is not needed. by not issuing t he reset, performance is improved through the reduction of overhead. 3.7 hot insertion support for the hot insertion will be required on the host but will be supported through the connector. connector manufac- tuers will provide connectors that have power pins long enough to be powered before contact is made with the other pins. please see connector data sheets for more details. this approach is similar to that used in pcmcia to allow for hot inser- tion. this applies to both multimediacard and spi modes. 3.3 flash independent technology
multimediacard tm 8 sep.22.2005 revision 0.3 3.8 multimediacard mode the samsung multimediacard is fully compliant with multimediacard standard specification v4.1 3.8.1 multimediacard standard compliance the multimediacard supports the operation condition verifi cation sequence defined in the multimediacard standard spec- ifications. the multimediacard host should define an operat ing voltage range that is not supported by the multimedi- acard. it will put itself in an inactive state and ignore an y bus communication. the only way to get the card out of the inactive state is by powering it down and up again. in addtion the host can explicitly send the ca rd to the inactive state by using the go_inactive_state command. 3.8.2 negotiating operation conditions multimediacard status is stored in a 32 bit status register which is sent as the data field in the card respond to host com- mands. status register provides informat ion about the card?s current state and completion codes for the last host com- mand. the card status can be explicityly read(polled) with the send_status command. 3.8.3 card status the basic unit of data transfer to/from the multimediacard is one byte. all data tr ansfer operations which require a block size always define block lenghs as integer multiples of byte s. some special funcions ne ed other partition granularity. for block oriented commands, the following definition is used: ? block: is the unit which is related to the block oriented read and write commands. its size is the number of bytes which will be transferred when one block command is sent by host. the size of a block is either programmable or fixed. the information about allowed block sizes and the programmability is stored in the csd. for r/w cards, special erase and wr ite protect commands are defined: ? the granularity of the erasable units is the erase group: the smalle st number of consecutive write blocks which can be addressed for erase. the size of the erase gr oup is card specific and stored in the csd. ? the granularity of the write protec ted units is the wp-group: the minimal unit which may be individually write pro- tected. its size is defined in units of erase groups. the si ze of a wp-group is card spec ific and stored in the csd. 3.8.4 memory array partitioning the multimediacard supports two read/write modes. in this mode the host reads or write one data block in a pr e-specified length block transmission is protected with 16bit crc which is generated by the sending unit and checked by the receiveing unit. misalignment is not allowed. every data block must be contained in a single memroy sector. the block lenght for write opertaion must be identical to the sector size and the start address aligned to a sector boundary. single block mode 3.8.5 read and write operations
multimediacard tm 9 sep.22.2005 revision 0.3 multiple block mode this mode is similar to the single block mode, but the host c an read/write multiple data blocks (all have the same length) which will be stored or retrived from contiguous memory add resses starting at the address specified in the command. the operation is terminated with a stop transmission command. misalignment and bl ock length restrictions apply to multi- ple blocks as well and are identical to the single block read/wr ite operations. multiple block read with pre-defined block is supported. every sector is protected with an error correction code (ecc). the ecc is generated (in the memory card) when the sectors are written and validated when the data is read. if de fects are found, the data is corrected prior to transmission to the host. the multimediacard can be considered error free and no additi onal data protection is needed. however, if an applciation uses additional, exteranal, ecc protection, the data oragnizati on is defined in the user writ eable section of the csd regis- ter. 3.8.6 data protection in the flash card the smallest erasable unit in the multimedi acard is a erase group. in order to s peed up the erase procedure, multiple erase groups can be erased in the same time. the erase operation is divided into two stages. tagging - selecting the sectors for erasing to facilitate selection, a first command with the starting add ress is followed by a second command with the final address, and all erase groups within this range will be selected for erase. erasing - starting the erase process tagging can address erase groups. an arbitrary selection of erase groups may be erased at one time. tagging and eras- ing must follow a strict command sequence (refer to t he multimediacard standard sepcification for datails). 3.8.7 erase the content of an multimediacard can be marked as an original or a copy using the copy bit in the csd register. once the copy bit is set (maked as a copy) it cannot be cleared. the copy bit of the multimediacard is programmed (during test and formatting on the manufacturing floor) as a copy. the multimediacard can be purchased with the copy bit set (copy) or cleared, indicating the card is a master. the one time programmable (otp) characteristic of the copy bit is implemented in the mu ltimediacard controller firm- ware and not with a physical otp cell. 3.8.9 copy bit all the configuration information of the multimediacard is st ored in the csd register. the m sb bytes of the register con- tain manufacturer data and two least significant bytes contains the host controlled data - the card copy and write protec- tion and the user ecc register. the host can read the csd register and alter the host controlled data bytes using the send_csd and program_csd commands. 3.8.10 the csd register 3.8.8 write protection two-card level write-protection options are available: permanent and temporary. both can be set using the program_csd command (refer to csd programming, section 6.2. 8). the permanent write protect bit, once set, can- not be clearded. this feature is implemented in the multimediacard /rs-multimediaca rd controller firmware and not with a physical otp cell.
multimediacard tm 10 sep.22.2005 revision 0.3 3.9 spi mode the operating condition negotiation functi on of the multimediacard bus is not suppor ted in spi mode. the host must work within the valid voltage range (2.7 to 3.6 volts) of the card. 3.9.1 negotiating operation conditions the spi mode is a secondary (optional) comm unication protocol offered for multimedia card. this mode is a subset of the multimediacard protocol, designed to communicate with an spi channel, commonly found in motorola?s(and lately a few other vendors?) microcontrollers. the card acquisition and identification func tion of the multimediacard bus is not supported in spi mode. the host must know the number of cards currently connected on the bus. specific card selection is done via the cs signal. 3.9.2 card acquisitio n and identification in spi mode only 16bits (containing the errors relevant to spi mode) can be read out of the multimediacard status regis- ter. 3.9.3 card status memory partioning in spi mode is equivalent to multimed iacard mode. all read and write commands are byte address- able. 3.9.4 memroy array partitioning in spi mode, only single block read/write mode is supported. 3.9.5 read and write operations in spi mode, only single block mode is supported. the typica l access time (latency) for each data block, in read opera- tion, is 1.5ms. the write typical access time (latency) for each data block, in read operation, is 1. 5ms. the write block operation is done in handshake mode. the card will keep dataou t line low as long as the write operation is in progress and there are no write buffers available. 3.9.6 data transfer rate same as in the multimediacard mode. 3.9.7 data protection in the multimediacard same as in the multimediacard mode. 3.9.8 erase
multimediacard tm 11 sep.22.2005 revision 0.3 temperature operation: -25c / 85c storage: -40c (168h) / 85c (500h) junction temperature: max. 95c moisture and corrosion operation: 25c / 95% rel. humidity stress: 40c / 93% rel. hum./500h salt water spray: 3% nacl/35c; 24h acc. mil std 883 method 1009 esd protection contact pads: +/- 4kv, human body model according to ansi eos/esd-s5.1-1998 non contact pads area: +/-8kv (coupling plane discharge) +/-15kv (air discharge) human body model according to iec61000-4-2 durability 10.000 mating cycles; test t.b.d. bending t.b.d. torque t.b.d. drop test 1.5m free fall uv light exposure uv: 200nm, 15ws/cm2 according to iso 7816-1 visual inspection shape and form no warpage; no mold skin; complete form; no cavities surface smoothness sigma-0.1 mm/cm 2 within contour; no cracks; no po llution (fat, oi l dust, etc.) table 4-1 : environmental specification summary 4. product specifications 4.1 reliability and durability
multimediacard tm 12 sep.22.2005 revision 0.3 c7 c6 c5 c4 c3 c2 c1 1.4 0.1 32 0.1 24 0.08 0.2 r 0.2 min all around 40.1 2 r 0.5 0.1 3 r 10.1 c8 c13 c12 c11 c10 c9 7.5 min 4.0 max 0.375 22.5 5 = 22.5 5 = 1.25 62.5 15 = 2.3 0.1 40.1 0.25 min 5.0 min 9.0 0.1 5.4 0.1 1.6 max 0.3 0.1 3.7 0.1 1.2 0.3 1.2 0.3 1.3 0.3 1.3 0.3 1.7 0.3 1.5 min 0.65 0.15 5 x 1.3 0.3 4.375 3.125 1.3 0.3 1.3 0.3 1.3 0.3 21.675 max 1.95 min 0.65 0.15 0.85 0.15 5.625 8.05 9.75 all dimensions in mm general tolerance: 0.1 center of narrower center of wider figure 4-1 : dimensions of a normal size multimediacard (bottom view, din) 4.2 mechanical design and format card package dimensions normal size: 24mm x 32mm; (min. 23.9mm x 31.9mm; max.24.1mm x 32.1mm) other dimensions figure 4-1 testing according to mil std 883, meth 2016 reduced size: 24mm x 18mm; (min. 23.9mm x 17.9mm; max.24.1mm x 18.1mm) other dimensions figure 4-3 testing according to mil std 883, meth 2016 thickness 1.4mm +- 0.1mm restrictions on usage of package material some area of the external surface of the card edge may not contain conductive materials (refer to figure 4-2) label or printable area whole card, except contact area surface plain (except contact area) edges smooth edges, see figure 4-1 inverse insertion protection on right corner (top view), see figure 4-1 position of esc contacts along middle of shorter edge; -0.625mm offset table 4-2 : physical specification summary
multimediacard tm 13 sep.22.2005 revision 0.3 0.3 0.3 1.4 0.1 24 0.08 0.2 r 0.2 min all around 18 0.1 18 0.1 3.1 2 0.35 3xr1 0.1 2xr0.5 4xr0.25 0.1 aa? 0.8 1.4 3.1 2 0.35 4.1 2xr0.5 2 4.1 2 a-a? cross section c7 c6 c5 c4 c3 c2 c1 c8 c13 c12 c11 c10 c9 1.5 min all dimensions in mm general tolerance: 0.1 0.3 0.8 c0.5 1.4 0.8 9.0 figure 4-3 : dimensions of a re duced size multimediacard (din) via holes are not allowed in this area pad length 0.5mm min figure 4-4 : location of pads? via holes
multimediacard tm 14 sep.22.2005 revision 0.3 15mm min usage of conductive material is not allowed on the external surface (this side of the card only) in this area 7.65mm max figure 4-2 : conductive material usage restrictions
multimediacard tm 15 sep.22.2005 revision 0.3 5. interface description 5.1 physical description 5.1.1 pin assignments the multimediacard has thirteen exposed contacts on one si de. the host is connected to the car using a dedicated thir- teen-pin connector. pin no. name type a a.s: power supply; i: input; o: output; pp: push-pull; od: open-drain; nc: not connected (or logical high) description multimediacard mode 1 dat3 i/o/pp data 2 cmd i/o/pp/od command/response 3v ss1 s supply voltage ground 4v dd s supply voltage 5 clk i clock 6v ss2 s supply voltage ground 7 dat0 b b.the dat0-dat7 lines for read-only cards are output only i/o/pp data 8 dat1 i/o/pp data 9 dat2 i/o/pp data 10 dat4 i/o/pp data 11 dat5 i/o/pp data 12 dat6 i/o/pp data 13 dat7 i/o/pp data spi mode 1 cs i chip select ( neg true ) 2 di i/pp data in 3 vss s supply voltage ground 4 vdd s supply voltage 5 sclk i clock 6 vss2 s supply vo ltage ground 7 do o/pp data out 8 not used 9 not used 10 not used 11 not used 12 not used 13 not used table 5-1 : multimediacard interface pin configuration
multimediacard tm 16 sep.22.2005 revision 0.3 the multimediacard bus has ten communication lines and three supply lines: ? cmd: command is a bidirectional signal. the hos t and card drivers are operating in two modes, open drain and push pull. ? dat0-7: data lines are bidirectional signals. ho st and card drivers are operating in push pull mode ? clk: clock is a host to card signal. clk operates in push pull mode ? v dd : v dd is the power supply line for all cards. ? v ss1 , v ss2 are two ground lines. figure 5-1 : bus circuitry diagram the r od is switched on and off by the host synchronously to the open-drain and push-pull mode transitions. the host does not have to have open drain drivers, but must recognize this mode to switch on the r od . r dat and r cmd are pull-up resistors protecting the cmd and t he dat lines against bus floating when no card is inserted or when all card drivers are in a high-impedance mode. a constant current source can replace the r od by achieving a better performance (constant slopes for the signal rising and falling edges). if the host does not allow the switchable r od implementation, a fixed r cmd can be used (the minimum value is defined in the chapter ). co nsequently the maximum operating frequen cy in the open drain mode has to be reduced if the used r cmd value is higher than the minimal one given in table 5-5. 5.2.1 hot insertion and removal to guarantee the proper sequence of card pin connection during hot insertion, the use of either a special hot-insertion capable card connector or an auto-detect loop on the host side (o r some similar mechanism) is mandatory (see chapter 4) no card shall be damaged by inserting or removing a ca rd into the multimediacard bus even when the power (v dd ) is up. data transfer operations ar e protected by crc codes, theref ore any bit changes induced by card insertion and removal can be detected by the multimediacard bus master. the inserted card must be properly reset also when clk carries a clock frequency f pp . each card shall have power protec- tion to prevent card (and host) damage. data transfer failu res induced by removal/insertion are detected by the bus mas- ter. they must be corrected by the applicat ion, which may repeat the issued command. cmd clk dat[7:0] multimediacard host r dat r od r cmd c 1 c 2 c 3 multimediacard 5.2 multimediacard bus topology
multimediacard tm 17 sep.22.2005 revision 0.3 5.2.2 power protection cards shall be inserted/removed into/from the bu s without damage. if one of the supply pins (v dd or v ss ) is not connected properly, then the current is drawn through a data line to suppl y the card. every card?s output also shall be able to with- stand shortcuts to either supply. if hot insertion feature is implemented in the host, than t he host has to withstand a short- cut between v dd and v ss without damage. 5.3 spi bus topology the spi mode consists of a secondary, optional communicat ion protocol which is offered by flash-based multimedi- acards. this mode is a subset of the multimediacard protocol, designed to communicate with a spi channel. the multi- mediacard spi interface is compatible with spi hosts avai lable on the market. as in any other spi device, the multimediacard spi channel consis ts of the following four signals: cs : host to card chip select signal clk : host to card clock signal datain : host to card data signal dataout : card to host data signal another spi common characteristic is byte transfers, which is implemented in the card as well. all data tokens are multi- ples of bytes (8 bit) and always byte aligned to the cs signal.the spi standard defines the physical link only, and not the complete data transfer protocol. the card identification and addressing methods are replaced by a hardware chip select (cs) signal. there are no broad- cast commands. for every command, a card (slave) is select ed by asserting (active low) the cs signal (see figure ). the cs signal must be continuously active for the duration of the spi transaction (command, response and data). the only exception occurs during card programming, when the host can de-assert the cs signal without affecting the program- ming process. the bidirectional cmd and dat lines are replaced by unidirectional datain and dataout signals. this eliminates the ability to excute commands while data is being read or written wh ich prevents swquential multi read/ write operations. only single block read/write is supported by the spi channel. figure 5-2 : multimediacard bus system 5.3.1 power protection power protection is the same as it is in multimediacard mode. spi bus (clk, datain, dataout ) spi bus master power supply cs spi card
multimediacard tm 18 sep.22.2005 revision 0.3 the following sections provide valuable in formation about the electrical interface. 5.4.1 power up the power-up of the multimediacard bus is handled loca lly in each card and the bus master. see figure 5-3 figure 5-3 : power-up diagram - after power up (including hot insertion, i.e. inserti ng a card when the bus is operating) the card enters the idle state . dur- ing this state the card ignores all bus transactions until cmd1 is received. - the maximum initial load (after power up or hot insertion) t hat the multimediacard can present on the vdd line shall be a maximum of 10 uf in parallel with a minimum of 330 ohms. at no time during operation shall the card capacitance on the vdd line exceed 10 uf - cmd1 is a special synchronization command used to negotiate th e operation voltage range and to poll the card until it is out of its power-up sequence. besides the operation voltage profile of the card, the response to cmd1 contains a busy flag, indicating that the card is still working on its power-u p procedure and is not ready for identification. this bit informs the host that the card is not ready. the host has to wait until this bit is cleared. the card shall complete its initialization within 1 second from the first cmd1 with a valid ocr range. - getting the card out of idle state is up to the responsibility of the bus master. since the power up time and the supply ramp up time depend on application parameters as the bus length and the power supply unit , the host must ensure that the power is built up to the operating level (the same level which will be specified in cmd1 ) before cmd1 is transmitted. - after power up the host starts the clock and sends the init ializing sequence on the cmd line. this sequence is a contigu- ous stream of logical ?1?s. the sequence length is the longes t of: 1msec, 74 clocks or the supply-ramp-up-time; the addi- tional 10 clocks (over the 64 cl ocks after what the card should be ready for co mmunication) is provided to eliminate power- up synchronization problems. every bus master has to implement cmd1. the cmd1 im plementation is mandatory for all multimediacards. supply voltage time supply ramp up time bus master supply voltage cmd1 cmd1 v dd max memory field working voltage range power up time initialization delay: optional repetitions of cmd1 v dd min the longest of: cmd2 n cc until the card is responding with busy bit set. cmd1 n cc n cc 1 msec, 74 clock cycles or the supply ramp up time initialization sequence card logic working voltage range first cmd1 to card ready 5.4 electrical interface
multimediacard tm 19 sep.22.2005 revision 0.3 5.4.2 bus operating conditions general power supply voltage - high voltage multimediacard power supply voltage - dual voltage multimediacard the current consumption of the card for the different card co nfigurations is defined in the power class fields in the ext_csd register. the current consumption of any card du ring the power-up procedure, while the host has not sent yet a valid ocr range, must not exceed 10 ma 5.4.3 bus signal line load the total capacitance c l of each line of the multimedi acard bus is the sum of the bus master capacitance c host , the bus capacitance c bus itself and the capacitance c card of the card connected to this line: c l = c host + c bus + c card requiring the sum of the host and bus capacitances not to exceed 20 pf: parameter symbol min max. unit remark peak voltage on all lines -0.5 3.6 v all inputs input leakage current -10 10 a all outputs output leakage current -10 10 a parameter symbol min max. unit remark supply voltage v dd 2.7 3.6 v supply voltage differentials (v ss1 , v ss2 )-0.50.5v parameter symbol min max. unit remark supply voltage (low voltage range) v ddl 1.65 1.95 v 1.95v - 2.7v is not supported supply voltage (high voltage range) v ddh 2.7 3.6 v supply voltage differentials (v ss1 , v ss2 )-0.50.5v parameter symbol min max. unit remark pull-up resistance for cmd r cmd 4.7 100 kohm to prevent bus floating pull-up resistance for dat0-7 r dat 50 100 kohm to prevent bus floating bus signal line capacitance c l 30 pf single card single card capacitance c card 7pf maximum signal line inductance 16 nh f pp <= 52 mhz table 5-2 : bus opeating conditions table 5-3 : power supply voltage table 5-4 : power supply voltage table 5-5 : host and bus capacities
multimediacard tm 20 sep.22.2005 revision 0.3 5.4.4 bus signal levels as the bus can be supplied with a variable supply voltage, all signal levels are related to the supply voltage. figure 5-4 : bus signal levels 5.4.5 open-drain mode bus signal level the input levels are identical with the push-pull mode bus signal levels. 5.4.6 push-pull mode bus signal level - high voltage multimediacard to meet the requirements of the jedec specification jesd8-1a, the card input and output voltages shall be within the fol- lowing specified ranges for any v dd of the allowed voltage range: 5.4.7 push-pull mode bus signal le vel - dual voltage multimediacard the definition of the i/o signal levels for the d ual voltage multimediacard changes as a function of v dd 2.7v - 3.6v: identical to the high voltage multimediacard (refer to chapter above) 1.95 - 2.7v: undefined. the card is not operating at this voltage range 1.65 - 1.95v: compatible with eia/jedec st andard ?eia/jesd8-7 wide range? as defined in the following table parameter symbol min max. unit conditions output high voltage v oh v dd -0.2 v i oh = -100 a output low voltage v ol 0.3 v i ol = 2 ma parameter symbol min max. unit conditions output high voltage v oh 0.75*v dd vi oh =-100 a @v dd min output low voltage v ol 0.125*v dd vi ol =100 a @v dd min input high voltage v ih 0.625*v dd v dd + 0.3 v input low voltage v il vss-0.3 0.25*v dd v v dd input input undefined v t output output high level low level high level low level v oh v ih v il v ol v ss table 5-6 : open drain mode bus signal levels table 5-7 : push-pull mode bus signal level - high voltage mulultimediacard
multimediacard tm 21 sep.22.2005 revision 0.3 5.4.8 bus & card interface timing figure 5-5 : timing diagram: data input/output parameter symbol min max. unit conditions output high voltage v oh v dd - 0.2v v i oh =-100 a @v dd min output low voltage v ol 0.2v v i ol =100 a @v dd min input high voltage v ih 0.7 * v dd v dd + 0.3 v input low voltage v il vss-0.3 0.3 * v dd v clock input output t pp t wl t wh t ih t thl data must always be sampled on the rising edge of the clock. t tlh t isu data invalid data data invalid data t oh t osu table 5-8 : push-pull mode bus signal level - dual voltage multimedicard
multimediacard tm 22 sep.22.2005 revision 0.3 parameter symbol min max. unit remark clock clk a a.all timing values are measured re lative to 50% of voltage level clock frequency data transfer mode (pp) b b.a multimediacard shall support the full frequency range from 0-26mhz, or 0-52mhz f pp 0 26/52 mhz c l <= 30 pf tolerance: +100khz clock frequency identification mode (od) f od 0 400 khz tolerance: +20khz clock low time t wl 6.5 ns c l <= 30 pf clock rise time c c.rise and fall times are measured from 10%-90% of voltage level t tlh 3nsc l <= 30 pf clock fall time t thl 3nsc l <= 30 pf inputs cmd, dat (referenced to clk) input set-up time t isu 3nsc l <= 30 pf input hold time t ih 3nsc l <= 30 pf outputs cmd, dat (referenced to clk) output set-up time t osu 5nsc l <= 30 pf output hold time t oh 5nsc l <= 30 pf signal rise time d d.rise and fall times are measured from 10%-90% of voltage level t rise 3nsc l <= 30 pf signal fall time t fall 3nsc l <= 30 pf parameter symbol min max. unit remark clock clk a a.all timing values are measured re lative to 50% of voltage level clock frequency data transfer mode (pp) f pp 020mhzc l <= 30 pf clock frequency identification mode (od) f od 0 400 khz clock low time t wl 10 ns c l <= 30 pf clock rise time b b.clock rise and fall times are measur ed from vil to vih of voltage level t tlh 10 ns c l <= 30 pf clock fall time t thl 10 ns c l <= 30 pf inputs cmd, dat (referenced to clk) input set-up time t isu 3nsc l <= 30 pf input hold time t ih 3nsc l <= 30 pf outputs cmd, dat (referenced to clk) output set-up time t osu 13.1 ns c l <= 30 pf output hold time t oh 9.7 ns c l <= 30 pf table 5-9 : high speed card interface timings table 5-10 : backwards compatible card interface timing
multimediacard tm 23 sep.22.2005 revision 0.3 5.5 multimediacard registers within the card interface six registers are defined: ocr, cid, csd, ext_csd, rca and dsr. these can be accessed only by corresponding commands (see chapter 6.6). the ocr, cid and csd registers carry the card/content specific information, while the rca and dsr regi sters are configuration registers storin g actual configuration parameters. the ext_csd register carries both, card specific information and actual configuration parameters. 5.5.1 ocr register the 32-bit operation conditio ns register stores the v dd voltage profile of the card. in addition, this register includes a sta- tus information bit. this status bit is set if the card power up procedure has been finished. the ocr register shall be implemented by all cards. the supported voltage range is coded as shown in table , for high voltage and dual voltage multimediacards. as long as the card is busy, the corresponding bit (31) is set to low, the ?wired-and? operation, descri bed in chapter 6.1.2 yields low, if at least one card is still busy. 5.5.2 cid register the card identification (cid) regi ster is 128 bits wide. it contains the card identification information used during the card identification phase (multim ediacard protocol). every individual flash or i/ o card shall have an unique identification num- ber. every type of multimediacard rom cards (defined by content) shall have an unique identification number. the structure of the cid register is defined in the following paragraphs: ocr bit vdd voltage window high voltage multimediacard dual voltage multimediacard [6:0] reserved 000 0000b 00 00000b [7] 1.65 - 1.95 0b 1b [14:8] 2.0-2.6 000 0000b 000 0000b [23:15] 2.7-3.6 1 1111 1111b 1 1111 1111b [30:24] reserved 000 0000b 000 0000b [31] card power up status bit (busy) a a.this bit is set to low if the card has not finished the power up routine name field width cid-slice cid value manufacturer id mid 8 [127:120] 0x15 oem/application id oid 16 [119:104] --- product name pnm 48 [103:56] --- product revision prv 8 [55:48] --- product serial number psn 32 [47:16] --- manufacturing date mdt 8 [15:8] --- crc7 checksum crc 7 [7:1] --- not used, always ?1? - 1 [0:0] --- table 5-12 : the cid fields
multimediacard tm 24 sep.22.2005 revision 0.3 ? mid an 8 bit binary number that identifies th e card manufacturer. the mid number is co ntrolled, defined and allocated to a mul- timediacard manufacturer by the mmca. this procedure is established to ensure uniqueness of the cid register. ? oid a 16 bit binary number that identifies th e card oem and/or the card contents (when used as a distribution media either on rom or flash cards). the oid number is controlled, defined and allocated to a multimediacard manu facturer by the mmca. this procedure is established to ensure uniqueness of the cid register. ? pnm the product name is a string, 6 ascii characters long. ? prv the product revision is composed of two binary coded decima l (bcd) digits, four bits each, representing an ?n.m? revi- sion number. the ?n? is the most significant nibble and ?m? is the least significant nibble. as an example, the prv binary value field for product revision ?6.2? will be: 0110 0010 ? psn a 32 bits unsigned binary integer. ? mdt the manufacturing date is composed of tw o hexadecimal digits, four bits each, representing a two digits date code m/y; the ?m? field, most significant nibble, is the month code. 1 = january. the ?y? field, least significant nibble, is the year code. 0 = 1997. as an example, the binary value of the mdt fiel d for production date ?april 2000? will be: 0100 0011 ? crc crc7 checksum (7 bits). this is th e checksum of the cid contents comp uted according to chapter 6.4. 5.5.3 csd register the card-specific data register provides information on how to access the card contents. the csd defines the data for- mat, error correction type, maxi mum data access time, data transfer speed, whether the dsr register can be used etc. the programmable part of the register ( entries marked by w or e, see below) can be changed by cmd27. the type of the entries in the table below is coded as follows:
multimediacard tm 25 sep.22.2005 revision 0.3 r = readable, w = writable once, e = erasable (multiple writable). name field width cell type csd- slice csd value csd structure csd_structure 2 r [127:126] v.1.2 system specification version spec_vers 4 r [125:122] v.4.1 reserved - 2 r [121:120] 0 data read access-time 1 taac 8 r [119:112] 1.5ms data read access-time 2 in clk cycles (nsac*100) nsac 8 r [111:104] 100 max. bus clock frequency tran_speed 8 r [103:96] 20mhz card command classes ccc 12 r [95:84] not support class:1,3,8,9,10,11 max. read data block length read_bl_len 4 r [83:80] 512bytes partial blocks for read allowed read_bl_partial 1 r [79:79] no write block misalignment write_blk_misalign 1 r [78:78] no read block misalignment re ad_blk_misalign 1 r [77:77] no dsr implemented dsr_imp 1 r [76:76] no reserved - 2 r [75:74] 0 device size c_size 12 r [73:62] --- max. read current @ v dd min vdd_r_curr_min 3 r [61:59] 60ma max. read current @ v dd max vdd_r_curr_max 3 r [58:56] 80ma max. write current @ v dd min vdd_w_curr_min 3 r [55:53] 60ma max. write current @ v dd max vdd_w_curr_max 3 r [52:50] 80ma device size multiplie r c_size_mult 3 r [49:47] --- erase group size erase_grp_size 5 r [46:42] --- erase group size multiplier erase_grp_mult 5 r [41:37] --- write protect group size wp_grp_size 5 r [36:32] --- write protect group enable wp_grp_enable 1 r [31:31] 1 manufacturer default ecc d efault_ecc 2 r [30:29] none write speed factor r2w_factor 3 r [28:26] --- max. write data block lengt h write_bl_len 4 r [25:22] 512 partial blocks for write allo wed write_bl_partial 1 r [21:21] no reserved - 4 r [20:17] 0 content protection applicat ion content_prot_app 1 r [16:16] --- file format group file_format_grp 1 r/w [15:15] 0 copy flag (otp) copy 1 r/w [14:14] --- permanent write protection perm_write_protec t 1 r/w [13:13] no temporary write protection tm p_write_protect 1 r/w/e [12:12] no file format file_format 2 r/w [11:10] 0 ecc code ecc 2 r/w/e [9:8] none crc crc 7 r/w/e [7:1] not used, always ?1? - 1 - [0:0] 1
multimediacard tm 26 sep.22.2005 revision 0.3 the following sections describe the csd fields and the relevant data types. if not explicitly defined otherwise, all bit string s are interpreted as binary coded numbe rs starting with the left bit first. ? csd_structure describes the version of the csd structure. ? spec_vers defines the multimediacard system specif ication version supported by the card. ? taac defines the asynchronous part of the data access time. ? nsac defines the typical case for the clock dependent factor of the data access time. the unit for nsac is 100 clock cycles. therefore, the maximal value for t he clock dependent part of the data access time is 25.5k clock cycles. the total access time n ac as expressed in table 23 is calculated based on taac and nsac. it has to be computed by the host for the actual clock rate. the read access time should be in terpreted as a typical delay for the first data bit of a data block or stream. csd_structure csd structure version valid for system sp ecification version 0 csd version no. 1.0 version 1.0 - 1.2 1 csd version no. 1.1 version 1.4 - 2.2 2 csd version no. 1.2 version 3.1 - 3.2 - 3.31 - 4.0 - 4.1 3 version is coded in the csd_structure byte in the ext_csd register spec_vers system specification version number 0 version 1.0-1.2 1 version 1.4 2 version 2.0 - 2.2 3 version 3.1 - 3.2 -3.31 4 version 4.0 - 4.1 5 - 15 reserved taac bit position code 2:0 time unit 0=1ns, 1=10ns, 2=100ns, 3=1s, 4=10s, 5=100s, 6=1ms, 7=10ms 6:3 multiplier factor 0=reserved, 1=1.0, 2=1.2, 3=1.3, 4=1.5, 5= 2.0, 6=2.5, 7=3.0, 8= 3.5, 9=4.0, a=4.5, b=5.0, c=5.5, d=6.0, e=7.0, f=8.0 7reserved
multimediacard tm 27 sep.22.2005 revision 0.3 ? tran_speed the following table defines the clock frequency when not in high speed mode. for cards supporting version 4.0, and higher, of the specification, t he value shall be 20mhz (0x2a): ? ccc the multimediacard command set is divided into subsets (command classes). the card command class register ccc defines which command classes are supported by this card. a value of ?1? in a ccc bit means that the corresponding com- mand class is supported. for command class definition refer to table 6-8. ? read_bl_len the data block length is computed as 2 read_bl_len . the block length might therefore be in the range 1, 2,4...2048 bytes (see chapter 6.10 for details): ? read_bl_partial defines whether partial block sizes can be used in block read commands. read_bl_partial=0 means that only the read_bl_len block size can be used for block oriented data transfers. read_bl_partial=1 means that smaller blocks can be used as well. the minimum block size will be equal to minimum addressable unit (one byte) tran_speed bit code 2:0 frequency unit 0=100khz, 1=1mhz, 2=10mhz, 3=100mhz, 4...7=reserved 6:3 multiplier factor 0=reserved, 1=1.0, 2=1.2, 3=1.3, 4=1.5, 5=2.0, 6=2. 6, 7=3.0, 8=3.5, 9=4.0, a=4.5, b=5.2, c=5.5, d=6.0, e=7.0, f=8.0 7 reserved ccc bit supported card command class 0 class 0 1 class 1 ...... 11 class 11 read_bl_len block length 0 2 0 = 1 byte 1 2 1 = 2 bytes ...... 11 2 11 = 2048 bytes 12-15 reserved
multimediacard tm 28 sep.22.2005 revision 0.3 ? write_blk_misalign defines if the data block to be written by one command can be spread over more than one physical block of the memory device. the size of the memory block is defined in write_bl_len. write_blk_misalign =0 signals that crossing physical block boundaries is invalid. write_blk_misalign =1 signals that crossing physical block boundaries is allowed. ? read_blk_misalign defines if the data block to be read by one command can be spread over more than one physical block of the memory device. the size of the memory block is defined in read_bl_len. read_blk_misalign =0 signals that crossing physical block boundaries is invalid. read_blk_misalign =1 signals that crossing physical block boundaries is allowed. ? dsr_imp defines if the configurable driver stage is integrated on the ca rd. if set, a driver stage register (dsr) must be implemented also (see chapter 5.5.6). ? c_size this parameter is used to compute the card capacity. the me mory capacity of the card is computed from the entries c_size, c_size_mult and read_bl_len as follows: memory capacity = blocknr * block_len where blocknr = (c_size+1) * mult mult = 2 c_size_mult+2 (c_size_mult < 8) block_len = 2 read_bl_len , (read_bl_len < 12) therefore, the maximal capacity which can be coded is 4096*512*2048 = 4 gbytes. example: a 4 mbyte card with block_len = 512 can be coded by c_size_mult = 0 and c_size = 2047. ? vdd_r_curr_min, vdd_w_curr_min the maximum values for read and write currents at the minimal power supply v dd are coded as follows: the values in these fields are valid when the card is not in high speed mode. when the card is in high speed mode, the current consumption is chosen by the host, from the power classes defined in the pwr_ff_vvv registers, in the ext_csd register. dsr_imp dsr type 0 dsr is not implemented 1 dsr implemented vdd_r_curr_min vdd_w_curr_min code for current consumption @ v dd 2:0 0=0.5ma; 1=1ma; 2=5ma; 3=10ma ; 4=25ma; 5=35ma; 6=60ma; 7=100ma
multimediacard tm 29 sep.22.2005 revision 0.3 ? vdd_r_curr_max, vdd_w_curr_max the maximum values for read and write currents at the maximal power supply v dd are coded as follows: the values in these fields are valid when the card is not in high speed mode. when the card is in high speed mode, the current consumption is chosen by the host, from the power classes defined in the pwr_ff_vvv registers, in the ext_csd register. ? c_size_mult this parameter is used for coding a factor mult for computi ng the total device size (see ?c_size?). the factor mult is defined as 2 c_size_mult+2 . ? erase_grp_size the contents of this register is a 5 bit binary coded value, used to calculate the size of the erasable unit of the card. the size of the erase unit (also referred to as erase gr oup) is determined by the erase_grp_size and the erase_grp_mult entries of the csd, using the following equation: size of erasable unit = (erase_grp_size + 1) * (erase_grp_mult + 1) this size is given as minimum number of write blocks that can be erased in a single erase command. ? erase_grp_mult a 5 bit binary coded value used for calc ulating the size of the er asable unit of the card. see erase_grp_size section for detailed description. ? wp_grp_size the size of a write protected group. the c ontents of this register is a 5 bit binary coded value, defining the number of erase groups which can be write protected. the actual size is com puted by increasing this number by one. a value of zero means 1 erase group, 31 means 32 erase groups. vdd_r_curr_max vdd_w_curr_max code for current consumption @ v dd 2:0 0=1ma; 1=5ma; 2=10ma; 3=25ma; 4=35ma; 5=45ma; 6=80ma; 7=200ma c_size_mult mult 0 2 2 = 4 1 2 3 = 8 2 2 4 = 16 3 2 5 = 32 4 2 6 = 64 5 2 7 = 128 6 2 8 = 256 7 2 9 = 512
multimediacard tm 30 sep.22.2005 revision 0.3 ? wp_grp_enable a value of ?0? means no group write protection possible. ? default_ecc set by the card manufacturer. it defines the ecc code which is recommended for use. the field definition is the same as for the ecc field described later. ? r2w_factor defines the typical block program time as a multiple of the read access time. the following table defines the field format. ? write_bl_len block length for write operations. see read_bl_len for field coding. ? write_bl_partial defines whether partial block sizes can be used in block write commands. write_bl_partial=?0? means that onl y the write_bl_len block size can be used for block oriented data write. write_bl_partial=?1? means that smaller blocks can be used as well. the minimum block size is one byte. ? file_format_grp indicates the selected group of file formats. this field is r ead-only for rom. the usage of this field is shown in table 5- 25 (see file_format). ? copy defines if the contents is original (= ?0?) or has been c opied (=?1?). the copy bit for otp and mtp devices, sold to end consumers, is set to ?1? which identifies the card contents as a copy. the copy bit is an one time programmable bit. ? perm_write_protect permanently protects the whole card cont ent against overwriting or erasing (all wr ite and erase commands for this card are permanently disabled). the default value is ?0?, i.e. not perman ently write protected. r2w_factor multiples of read access time 01 1 2 (write half as fast as read) 24 38 416 532 664 7128
multimediacard tm 31 sep.22.2005 revision 0.3 ? tmp_write_protect temporarily protects the whole card content from being overwritten or erased (all write and erase commands for this card are temporarily disabled). this bit can be set and reset. the default value is ?0?, i.e. not write protected. ? content_prot_app this field in the csd indicates whether the content protecti on application is supported. mu ltimediacards which implement the content protection applicati on will have this bit set to ?1?; ? file_format indicates the file format on the card. this field is read-only for rom. the following formats are defined: a more detailed description is given in "file formats specifications for multimediacards". ? ecc defines the ecc code that was used for storing data on the ca rd. this field is used by the host (or application) to decode the user data. the following table defines the field format.: ? crc the crc field carries the check sum for th e csd contents. it is computed accordin g to chapter 6.4. the checksum has to be recalculated by the host for any csd modification . the default corresponds to the initial csd contents. file_format_grp file_format type 0 0 hard disk-like file syst em with partition table 0 1 dos fat (floppy-like) with boot se ctor only (no partition table) 0 2 universal file format 0 3 others / unknown 1 0, 1, 2, 3 reserved ecc ecc type maximum number of correctable bits per block 0 none (default) none 1 bch (542,512) 3 2-3 reserved -
multimediacard tm 32 sep.22.2005 revision 0.3 the following table lists the correspondence between the csd en tries and the command classes. a ?+? entry indicates that the csd field affects the commands of the related command class. 5.5.4 extended csd register the extended csd register defines the card properties and selected modes. it is 512 bytes long. the most significant 320 bytes are the prop erties segment, which defi nes the card capabilities an d cannot be modified by the host. the lower 192 bytes are the modes segment, which defines the configur ation the card is working in. these modes can be changed by the host by means of the switch command command classes csd field 0 1 2 3 4 5 6 7 8 9 csd_structure ++++++++++ spec_vers ++++++++++ taac ++++++++ nsac ++++++++ tran_speed + + + + ccc ++++++++++ read_bl_len + read_bl_partial + write_blk_misalign + read_blk_misalign + dsr_imp ++++++++++ c_size_mant ++++++++ c_size_exp ++++++++ vdd_r_curr_min + + vdd_r_curr_max + + vdd_w_curr_min ++++++ vdd_w_curr_max ++++++ erase_grp_size ++++ wp_grp_size +++ wp_grp_enable +++ default_ecc ++++++++ r2w_factor ++++++ write_bl_len ++++++ write_bl_partial ++++++ file_format_grp copy ++++++++++ perm_write_protect ++++++++++ tmp_write_protect ++++++++++ file_format ecc ++++++++ crc ++++++++++
multimediacard tm 33 sep.22.2005 revision 0.3 name field size (bytes) cell type csd-slice properties segment reserved 1 7 [511:505] supported command sets s_cmd_set 1 r [504] reserved 1 293 [503:211] minimum write performance for 8b it @52mhz min_perf_w_8_52 1 r [210] minimum read performance for 8bit @52mhz min_perf_r_8_52 1 r [209] minimum write performance for 8bit @26mhz / 4bit @52mhz min_perf_w_8_26_4_52 1 r [208] minimum read performance for 8bit @26mhz / 4bit @52mhz min_perf_r_8_26_4_52 1 r [207] minimum write performance for 4b it @26mhz min_perf_w_4_26 1 r [206] minimum read performance for 4bit @26mhz min_perf_r_4_26 1 r [205] reserved 1 1 [204] power class for 26mhz @ 3.6v pwr_cl_26_360 1 r [203] power class for 52mhz @ 3.6v pwr_cl_52_360 1 r [202] power class for 26mhz @ 1.95v pwr_cl_26_195 1 r [201] power class for 52mhz @ 1.95v pwr_cl_52_195 1 r [200] reserved 1 3 [199:197] card type card_type 1 r [196] reserved 1 1 [195] csd structure version csd_structure 1 r [194] reserved 1 1 [193] extended csd revision ext_csd_rev 1 r [192] modes segment command set cmd_set 1 r/w [191] reserved 1 1 [190] command set revision cmd_set_rev 1 ro [189] reserved 1 1 [188] power class power_class 1 r/w [187] reserved 1 1 [186] high speed interface timing hs_timing 1 r/w [185] reserved 1 1 [184] bus width mode bus_width 1 wo [183] reserved a a.reserved bits should read as ?0? 183 [182:0] table 5-27 : extended csd
multimediacard tm 34 sep.22.2005 revision 0.3 ? s_cmd_set this field defines which command sets are supported by the card. ? min_perf_a_b_ff these fields defines the overall minimum performance value for the read and write access with different bus width and max clock frequency modes. the value in the register is coded as follows. other than defined values are illegal. bit command set 7-3 reserved 2 content protection securemmc 1 securemmc 0 standard mmc value performance 0x00 for cards not reaching the 2.4mb/s minimum value 0x08 class a: 2.4mb/s and is the lowest allo wed value for mmcplus and mmcmobile(16x150kb/s) 0x0a class b: 3.0mb/s and is the next allowed value (20x150kb/s) 0x0f class c: 4.5mb/s and is the next allowed value (30x150kb/s) 0x14 class d: 6.0mb/s and is the next allowed value (40x150kb/s) 0x1e class e: 9.0mb/s and is the next allowed value (60x150kb/s) this is also the highest class which any mmcplus or mmcmobile card is needed to support in low bus category operation mode (26mhz with 4bit data bus). a mmcplus or mmcmobile card supporting any higher class than this have to support this class also (in low category bus operation mode). 0x28 class f: equals 12.0mb/s and is the next allowed value (80x150kb/s) 0x32 class g: equals 15.0mb/s and is the next allowed value (100x150kb/s) 0x3c class h: equals 18.0mb/s and is the next allowed value (120x150kb/s) 0x46 class j: equals 21.0mb/s and is the next allowed value (140x150kb/s) this is also the highest class which any mmcplus or mmcmobile card is needed to support in mid bus category operation mode (26mhz with 8bit data bus or 52mhz with 4bit data bus). a mmcplus or mmcmobile card supporting any higher class than this have to support this class (in mid category bus operation mode) and class e also (in low category bus operation mode) 0x50 class k: equals 24.0mb/s and is the next allowed value (160x150kb/s) 0x64 class m: equals 30.0mb/s and is the next allowed value (200x150kb/s) 0x78 class o: equals 36.0mb/s and is the next allowed value (240x150kb/s) 0x8c class r: equals 42.0mb/s and is the next allowed value (280x150kb/s) 0xa0 class t: equals 48.0mb/s and is the last defined value (320x150kb/s) table 5-28 : r/w access performance value
multimediacard tm 35 sep.22.2005 revision 0.3 ? pwr_cl_ff_vvv these fields define the supported power classes by the card. by default, the card has to operate at maximum frequency using 1 bit bus configuration, within the default max current consumption, as stated in the table below. if 4 bit/8 bits bus configurations, require increased current consumption, it has to be stated in these registers. by reading these registers the host can determine the power cons umption of the card in different bus modes. bits [7:4] code the current consumption for the 8 bit bus configuration. bits [3:0] code the current c onsumption for the 4 bit bus con- figuration the pwr_52_vvv registers are not def ined for 26mhz multimediacards. the measurement for max rms current is done as aver age rms current consumption over a period of 100ms. max peak current is defined as absolute max value not to be exceeded at all. the conditions under which the power classes are defined are: ? maximum bus frequency ? maximum operating voltage ? worst case functional operation ? worst case environmental parameters (temperature,...) these registers define the maximum power consumption for any protocol operation in data transfer mode, ready state and identification state. voltage value max rms current max peak current remarks 3.6v 0 100 ma 200 ma default current consumption for high voltage cards 1 120 ma 220 ma 2 150 ma 250 ma 3 180 ma 280 ma 4 200 ma 300 ma 5 220 ma 320 ma 6 250 ma 350 ma 7 300 ma 400 ma 8 350 ma 450 ma 9 400 ma 500 ma 10 450 ma 550 ma 11-15 reserved for future use 1.95v 0 65 ma 130 ma default current consumption for dual voltage cards 1 70 ma 140 ma 2 80 ma 160 ma 3 90 ma 180 ma 4 100 ma 200 ma 5 120 ma 220 ma 6 140 ma 240 ma 7 160 ma 260 ma 8 180 ma 280 ma 9 200 ma 300 ma 10 250 ma 350 ma 6-15 reserved for future use
multimediacard tm 36 sep.22.2005 revision 0.3 ? card_type this field defines the type of the card. the only currently valid values for this field are 0x01 and 0x03. ? csd_structure this field is a continuation of the cs d_structure field in the csd register ? ext_csd_rev defines the fixed parameters. related to the ext_csd, according to its revision ? cmd_set contains the binary code of the command set that is currently ac tive in the card. it is set to ?0? (standard mmc) after power up and can be changed by a switch command. ? cmd_set_rev contains a binary number reflecting the revision of the cu rrently active command set. fo r standard mmc. command set it is: this field, though in the modes segment of the ext_csd, is read only. bit card type 7:2 reserved 1 high speed multimediacard @ 52mhz 0 high speed multimediacard @ 26mhz csd_structure csd structure version valid for system sp ecification version 0 csd version no. 1.0 version 1.0 - 1.2 1 csd version no. 1.1 version 1.4 - 2.2 2 csd version no. 1.2 version 3.1 - 3.2 - 3.31 - 4.0 - 4.1 3 reserved for future use 4-255 reserved for future use ext_csd_rev extended csd revision 255-2 reserved 1 revision 1.1 0 revision 1.0 code mmc revisions 255-1 reserved 0v4.0
multimediacard tm 37 sep.22.2005 revision 0.3 ? power_class this field contains the 4 bit value of the selected power class for the card. the power classes are defined in table . the host should be responsible of properly writing this field with the maximum power class it allows the card to use. the card uses this information to, internally, manage the power budget and deliver an optimized performance. this field is 0 after power-on or software reset. ? hs_timing this field is 0 after power-on, or software reset, thus select ing the backwards compatibility interface timing for the card. if the host writes 1 to this field, the ca rd changes its timing to high speed in terface timing (refer to chapter 5.4.8) ? bus_width it is set to ?0? (1 bit data bus) after power up and can be changed by a switch command. 5.5.5 rca register the writable 16-bit relative card address register carries the card address assigned by the host during the card identifica- tion. this address is used for the addressed host-card communic ation after the card identification procedure. the default value of the rca register is 0x0001. the val ue 0x0000 is reserved to set all cards into the stand-by state with cmd7. 5.5.6 dsr register the 16-bit driver stage register can be optionally used to improve the bus performance for extended operating conditions (depending on parameters like bus length, transfer rate or number of cards). the csd register carries the information about the dsr register usage. the defaul t value of the dsr register is 0x404. bits description [7:4] reserved [3:0] card power class code (see table 5-2 9 ) value bus mode 255-3 reserved 2 8 bit data bus 1 4 bit data bus 0 1 bit data bus
multimediacard tm 38 sep.22.2005 revision 0.3 6. multimediacard protocol description all communication between host and card is controlled by th e host (master). the host s ends commands of two types: broadcast and addressed (point-to-point) commands. ? broadcast commands : broadcast commands ar e intended for all cards in a multimed iacard system 1 . some of these commands require a response. ? addressed (point-to-point) commands : the address ed commands are sent to the addressed card and cause a response from this card. a general overview of the command flow is shown in figure 6-1 for the card identification mode and in figure 6-2 for the data transfer mode. the commands are listed in the command tables (table 6-9 - table 6-17). the dependencies between current state, received command and following state are listed in table 6-18. in the following sections, the different card operation modes are described first. thereafter, the restricti ons for controlling the clock signal are defined. all multimedi- acard commands together with the corresponding responses, stat e transitions, error conditions and timings are presented in the succeeding sections. three operation modes are defined for the multimediacard system (hosts and cards): ? card identification mode the host will be in card identificat ion mode after reset, while it is looking for a card on the bus. the card will be in this mode after reset, until the set_rca command (cmd3) is received. ? interrupt mode host and card enter and exit interrupt mode simultaneous ly. in interrupt mode there is no data transfer. the only mes sage allowed is an interrupt service request from the card or the host. ? data transfer mode the card will enter data transfer mode once an rca is assigned to it. the host will enter data transfer mode after iden tifying the card on the bus. the following table shows the dependencies between bus modes , operation modes and card states. each state in the multimediacard state diagram (see figure 6-1 and figure 6-2 ) is associated with one bus mode and one operation mode: 1.broadcast commands are kept for backwards compatibility to previous mu ltimediacard systems, wh ere more than one card was allowed on the bus. card state operation mode bus mode inactive state inactive open-drain idle state card identification mode ready state identification state stand-by state data transfer mode push-pull transfer state bus-test state sending-data state receive-data state programming state disconnect state wait-irq state interrupt mode open-drain
multimediacard tm 39 sep.22.2005 revision 0.3 6.1 card identification mode while in card identification mode the host resets the card, validates operat ion voltage range, identifies the card and assigns a relative card address (rca) to the card on the bus . all data communication in the card identification mode uses the command line (cmd) only. 6.1.1 card reset after power-on by the host, the cards (even if it has been in inactive state) is in multimediacard mode (as opposed to spi mode) and in idle state. command go_idle_state (cmd0) is the software reset command and puts the card into idle state. it is also used to switch the card into spi mode (refer to chapter 7 for details). after power-on, or cmd0, the cards? output bus drivers are in high-impedance state and the card is initialized with a default relative card address (?0x0001?) and with a default driv er stage register setting (lowest speed, highest driving cur- rent capability). the host clocks the bus at the identifi cation clock rate f od (see chapter 5.4.8). cmd0 is valid in all stat es, with the exception of inactive state . while in inactive state the card does not accept cmd0, unless it is used to switch the card into spi mode. 6.1.2 operating voltage range validation each type of multimediacard (either high voltage or dual volt age) shall be able to establis h communication with the host, as well as perform the actual card function (e.g. accessing memory), using any operating voltage within the voltage range specified in this standard, for the gi ven card type (see chapter 5.4.2). the send_op_cond (cmd1) command is designed to provide multimediacard hosts with a mechanism to identify and reject cards which do not match the v dd range desired by the host. this is acco mplished by the host sending the required v dd voltage window as the operand of this command (see chapter 5.5.1). if the card can not perform data transfer in the specified range it must discard itself from further bus operations and go into inactive state . otherwise, the card shall respond sending back its v dd range. for this, the levels in the ocr r egister shall be defined accordingly (see chapter 5.5.1).
multimediacard tm 40 sep.22.2005 revision 0.3 figure 6-1 : multimediacard state diagram (card iden tification mode) by omitting the voltage range in the command (by setting th e argument of cmd1 to 0), the host can query the card and determine the voltage type of the card. this bus query should be used if the host is able to select a common voltage range, or if a notification to the application of a non usable card in the bus is desired. afterwards, the host must choose a voltage for operation, and reissue cmd1 with this condition, sending incomp atible cards into the inactive state . the busy bit in the cmd1 response can be used by a card to te ll the host that it is still working on its power-up/reset pro- cedure (e.g. downloading the register information from memory field) and is not ready yet for communication. in this case the host must repeat cmd1 until the busy bit is cleared. during the initialization procedure, the host is not allowed to change the operating voltage range. such changes shall be ignored by the card. if there is a real change in the operati ng conditions, the host must reset the card (using cmd0) and restart the initialization procedure. however, for accessing cards already in inactive state , a hard reset must be done by switching the power supply off and back on. the command go_inactive_state (cmd15) can be used to send an addressed card into the inactive state . this com- mand is used when the host explicitly wants to deactivate a card (e.g. host is changing v dd into a range which is known to be not supported by this card). ready state cmd1 inactive state (ina) idle state (idle) (ready) identification state (ident) cmd0 cmd3 cmd2 from all states except (ina) from all states in cmd15 card looses bus card wins bus cards with non compatible voltage range card is busy or data-transfer mode card-identification mode data-transfer-mode stand-by state (stby) power on cmd40 data-transfer mode interrupt mode wait-irq state (irq) any start bit detected on the bus host omitted voltage range
multimediacard tm 41 sep.22.2005 revision 0.3 the command cmd1 shall be implemented by all cards defined by this standard. if the host intends to operate the dual voltage multimediacard s in the 1.65v to 1.95v range, it is recommended that the host first validate the operating voltage in the 2.7v to 3.6v range, then power the card down fully, and finally power the card back up to the 1.65v to 1.95v range for operation. using the 2.7v to 3.6v range initia lly, which is common to high and dual voltage multimediacards, will allow reliable screening of host & card voltage incompatibilities. high voltage cards may not function properly if vdd < 2.0v is used to establish co mmunication. dual voltage cards may fail if 1.95 to 2.7v is used. 6.1.3 card identification process the following explanation refers to a card working in a multi-card environment, as defined in ve rsions of this standard pre- vious to v4.0, and it is maintained for backwards compatibility to those systems. the host starts the card identific ation process in open-drain mode wi th the identification clock rate f od (see chapter 5.4.8). the open drain driver stages on the cmd line allow pa rallel card operation during card identification. after the bus is activated, the host will request the cards to send its valid operation conditions (cmd1). the response to cmd1 is the ?wired and? operation on the condition restrictio ns of all cards in the system. in compatible cards are sent into inactive state . the host then issues the broadcast command all_send_cid (cmd2), asking all cards for its unique card identification (cid) number. all unident ified cards (i.e. those which are in ready state ) simultaneously start sending their cid numbers serially, while bit-wise monitoring their outgoi ng bitstream. those cards, wh ose outgoing cid bits do not match the corresponding bits on the command line in any one of the bit periods, stop sending their cid immediately and must wait for the next identific ation cycle (remaining in the ready state ). since cid numbers are unique for each card, there should be only one card which successfully sends its fu ll cid-number to the host. this card then goes into identifica- tion state . thereafter, the host issues cmd3 (set_relative_a ddr) to assign to this card a relative card address (rca), which is shorter than cid and which will be used to address the card in the future data transfer mode (typically with a higher clock rate than f od ). once the rca is received the card state changes to the stand-by state, and the card does not react to further iden tification cycles. furthermo re, the card switches its output drivers from open-drain to push-pull. the host repeats the identification process, i.e. the cycles wit h cmd2 and cmd3 as long as it receives a response (cid) to its identification command (cmd2). if no more card responds to this command, all cards have been identified. the time- out condition to recognize completion of the identification proc ess is the absence of a start bit for more than n id clock cycles after sending cmd2 (see ti ming values in chapter 6.11).
multimediacard tm 42 sep.22.2005 revision 0.3 6.2 data transfer mode when the card is in stand-by state, communication over the cmd and dat li nes will be performed in push-pull mode. until the contents of the csd regist er is known by the host, the f pp clock rate must remain at f od (see chapter 5.4.8). the host issues send_csd (cmd9) to obtain the card specific data (csd register), e.g. block length, card storage capacity, maximum clock rate, etc. figure 6-2 : multimediacard state diagram (data transfer mode) the broadcast command set_dsr (cmd4) configures the driver stages of the card. it progra ms its dsr register corre- sponding to the application bus layout (length) and the data transfer frequency. the clock rate is also switched from f od to f pp at that point. cmd7 is used to select the card and put it into the transfer state . if the card was previously selected and was in transfer state its connection with the host is rel eased and it will move back to the stand-by state . when cmd7 is issued with the reserved relative card address ?0 x0000?, the card is put back to stand-by state . after the card is assigned an rca it will not respond to identification commands (cmd1, cmd2, cmd3, see chapter 6.1.3). state (tran) stand-by state (stby) transfer sending-data state (data) cmd3 cmd4 cmd7 9,10,39 cmd16, cmd7 cmd8,11,17, 18, 30, 56(r) data transfer card identification cmd13 & cmd55 in data-transfer-mode no state transition cmd12, ?operation 23,35,36 state (rcv) receive-data 24,25,26,27,42, 56(w) cmd20, cmd15 from all states in data-transfer-mode state (prg) programming 28, 29, 38 cmd 6, ?operation complete? state (dis) disconnect cmd7 ?operation complete? cmd0 cmd7 complete? cmd24, 25 cmd12 or ?transfer end? mode mode cmd40 wait-irq state (irq) any start bit detected on the bus interrupt mode cmd19 bus test state (btst) cmd14
multimediacard tm 43 sep.22.2005 revision 0.3 all data communication in the data transfer mode is point-t o point between the host and the selected card (using addressed commands). all addressed commands get acknowledged by a response on the cmd line. the relationship between the various data transfer modes is summarized below (see figure 6-2): ? all data read commands can be aborted any time by the stop command (cmd12). the data transfer will terminate and the card will return to the transfer state. the read commands are: block read (cmd17), multiple block read (cmd18) and send write protect (cmd30). ? all data write commands can be aborted any time by the stop command (cmd12). the write commands must be stopped prior to deselecting the card by cmd7. the write commands are: block writ e (cmd24 and cmd25), write cid (cmd26), and write csd (cmd27). ? as soon as the data transfer is completed, the card will exit the data write state and move either to the programming state (transfer is successful) or transfer state (transfer failed). ? if a block write operation is stopped and the block lengt h and crc of the last block are valid, the data will be pro grammed. ? the card may provide buffering for stream and block write. this means that the next block can be sent to the card while the previous is being programmed. ? if all write buffers are full, and as long as the card is in programming state (see multimediacard state diagram figure -2), the dat0 line will be kept low. ? there is no buffering option for write csd, write cid, writ e protection and erase. this means that while the card is busy servicing any one of these commands, no other data transfer commands will be accepted. dat0 line will be kept low as long as the card is busy and in the programming state . ? parameter set commands are not allowed while card is programming. parameter set commands are: set block length (cmd16), and erase group selection (cmd35-36). ? read commands are not allowed while card is programming. ? moving another card from stand-by to transfer state (using cmd7) will not terminat e a programming operation. the card will switch to the disconnect state and will release the dat0 line. ? a card can be rese lected while in the disconnect state , using cmd7. in this case the card will move to the program ming state and reactivate the busy indication. ? resetting a card (using cmd0 or cmd15) will terminate any pending or active programming operation. this may destroy the data contents on the card. it is up to the host?s responsibility to prevent this. ? prior to executing the bus testi ng procedure (cmd19, cmd14), it is recommended to set up the clock frequency used for data transfer. this way the bus test gives a true re sult, which might not be the case if the bus testing procedure is performed with lower clock frequency than the data transfer frequency. in the following format definitions, all upper case flags and parameters are defined in the csd (chapter 5.5.3), and the other status flags in the card status (chapter 6.9).
multimediacard tm 44 sep.22.2005 revision 0.3 6.2.1 command sets and extended settings the card operates in a given command se t, by default, after a power cycle or rese t by cmd0, it is the multimediacard standard command set, using a single data line, dat0. the host can change the active command set by issuing the switch command (cmd6) with the ?command set? access mode selected. the supported command sets, as well as the currently sele cted command set, are defined in the ext_csd register. the ext_csd register is divided in two segments, a properti es segment and a modes segment. the properties segment con- tains information about the card capabilities. the modes s egment reflects the current selected modes of the card. the host reads the ext_csd register by issuing the se nd_ext_csd command. the card sends the ext_csd register as a block of data, 512 bytes long. any rese rved, or write only field, reads as ?0?. the host can write the modes segment of the ext_csd register by issuing a switch command and setting one of the access modes. all three modes access and modify on e of the ext_csd bytes, the byte pointed by the index field 1 table 6-2 : ext_csd access modes the switch command can be used either to write the ext_csd register or to change the command set. if the switch command is used to change the command set, the index and va lue field are ignored, and the ext_csd is not written. if the switch command is used to write the ext_csd regist er, the cmd set field is ignored, and the command set remains unchanged. the switch command response is of type r1b, therefore, the host should read the card status, using send_status command, after the busy signal is de-asserted, to check the result of the switch operation. 6.2.2 high speed mode selection after the host verifies that the card compli es with version 4.0, or highe r, of this standard, it has to enable the high speed mode timing in the card, before changing the clock frequency to a frequency higher than 20mhz. after power-on, or software reset, the interface timing of the card is set as specified in table 5-7, chapter 5. for the host t o change to a higher clock frequency, it has to enable the hi gh speed interface timing. the host uses the switch command to write 0x01 to the hs_timing byte, in t he modes segment of the ext_csd register. the valid values for this register are defined in ?hs_timing?, in page 37. if the host tries to write an invalid value, the hs_timing byte is not changed, the high speed interface timing is not enabled, and the switch_error bit is set. 6.2.3 power class selection after the host verifies that the card complies with version 4.0, or higher, of this standard, it may change the power class of the card. after power-on, or software reset, the ca rd power class is class 0, which is the default, minimum current consumption class for the card type, either high vo ltage or dual voltage card. the pwr_cl _ff_vvv bytes, in the ext_csd register, reflect the power consumption levels of the card, for a 4 bits bus, an 8 bit bus, at the supported clock frequencies (26mhz or 52mhz). the host reads this information, using the send_ext_csd comma nd, and determines if it will allow the card to use a higher power class. if a power class change is needed, th e host uses the switch command to write the power_class byte, in the modes segment of the ext_csd register. the valid values for this regist er are defined in ?pwr_cl_ff_vvv?, in page 84 if the host tries to write an inva lid value, the power_class byte is not changed and the switch_error bit is set. access bits access name operation 00 command set the command set is changed according to the cmd set field of the argument 01 set bits the bits in the pointed byte are set, according to the ?1? bits in the value field. 10 clear bits the bits in the pointed byte are cleared, according to the ?1? bits in the value field. 11 write byte the value field is written into the pointed byte. 1.the index field can contain any value from 0-255, but only valu es 0-191 are valid values. if the index value is in the 192-25 5 range the card does not perform a ny modification and the switch _error status bit is set.
multimediacard tm 45 sep.22.2005 revision 0.3 6.2.4 bus testing procedure by issuing commands cmd19 and cmd14 the host can detect the functional pins on the bus. in a first step, the host sends cmd19 to the card, followed by a specific data pattern on each selected data lines. the data pattern to be sent per data line is defined in the table below. as a second step, the host sends cmd14 to request the card to send back the reversed data pattern. with the data pattern sent by the host and with the reversed pattern sent back by the card, the func- tional pins on the bus can be detected. the card ignores all but the two first bits of the data pattern. therefore, the card buffer size is not limiting the maximum length of the data pattern. the minimum lengt h of the data pattern is two bytes, of which the first two bits of each data line are sent back, by the card, reversed. the data pattern sent by t he host may optionally incl ude a crc16 checksum, which is ignored by the card. the card detects the start bit on dat0 and synchronize s accordingly the reading of all its data inputs. the host ignores all but the two first bits of the reverse data pattern. the length of the reverse data pattern is eight bytes and is always sent using all the card?s dat lines (see table through table ). the reverse data pattern sent by the card may optionally include a crc16 checksu m, which is ignored by the host. the card has pull ups in all data inputs. in cases where the card is connected to only 1bit or only 4bit hs-mmc system, the input value of the upper bits (e.g. dat1-dat7 or dat4-dat7) are detected as logical ?1? by the card. . start bit data pattern end bit 0 1 0 x x x x ... x x 1 data line data pattern sen t by the host reversed pattern sent by the card notes dat0 0,10xxxxxxxxxx,[crc16],1 0,01000000,[crc16],1 start bit defines beginning of pattern dat1 0,00000000,[crc16],1 no data pattern sent dat2 0,00000000,[crc16],1 no data pattern sent dat3 0,00000000,[crc16],1 no data pattern sent dat4 0,00000000,[crc16],1 no data pattern sent dat5 0,00000000,[crc16],1 no data pattern sent dat6 0,00000000,[crc16],1 no data pattern sent dat7 0,00000000,[crc16],1 no data pattern sent table 6-3 : 1-bit bus testing pattern
multimediacard tm 46 sep.22.2005 revision 0.3 6.2.5 bus width selection after the host has verified the functional pins on the bus it should change the bus width configuration accordingly, using the switch command. the bus width configuration is changed by writing to the bus_width byte in t he modes segment of the ext_csd regis- ter (using the switch command to do so). after power-on, or software reset, the contents of the bus_width byte is 0x00. the valid values for this register are defined in ?bus_width?, in page 86. if the host tries to write an invalid value, the bus_width byte is not changed and the switch_e rror bit is set. this register is write only. 6.2.6 data read the dat0-dat7 bus line levels are high when no data is transm itted. a transmitted data block consists of a start bit (low), on each dat line, followed by a continuous data st ream. the data stream contains the payload data (and error correction bits if an off-card ecc is used). the data stream ends with an end bit (high), on each dat line (see figure 6- 12 - figure 6-14). the data transmission is synchronous to the clock signal. the payload for block oriented data transfer is protected by a crc check sum, on each dat line (see chapter 6.4). data line data pattern sen t by the host reversed pattern sent by the card notes dat0 0,10xxxxxxxxxx,[crc16],1 0,01000000,[crc16],1 start bit defines beginning of pattern dat1 0,01xxxxxxxxxx,[crc16],1 0,10000000,[crc16],1 dat2 0,10xxxxxxxxxx,[crc16],1 0,01000000,[crc16],1 dat3 0,01xxxxxxxxxx,[crc16],1 0,10000000,[crc16],1 dat4 0,00000000,[crc16],1 no data pattern sent dat5 0,00000000,[crc16],1 no data pattern sent dat6 0,00000000,[crc16],1 no data pattern sent dat7 0,00000000,[crc16],1 no data pattern sent data line data pattern sen t by the host reversed pattern sent by the card notes dat0 0,10xxxxxxxxxx,[crc16],1 0,01000000,[crc16],1 start bit defines beginning of pattern dat1 0,01xxxxxxxxxx,[crc16],1 0,10000000,[crc16],1 dat2 0,10xxxxxxxxxx,[crc16],1 0,01000000,[crc16],1 dat3 0,01xxxxxxxxxx,[crc16],1 0,10000000,[crc16],1 dat4 0,10xxxxxxxxxx,[crc16],1 0,01000000,[crc16],1 dat5 0,01xxxxxxxxxx,[crc16],1 0,10000000,[crc16],1 dat6 0,10xxxxxxxxxx,[crc16],1 0,01000000,[crc16],1 dat7 0,01xxxxxxxxxx,[crc16],1 0,10000000,[crc16],1 table 6-5 : 8-bit bus testing pattern table 6-4 : 4-bit bus testing pattern
multimediacard tm 47 sep.22.2005 revision 0.3 ? block read block read is similar to stream read, exc ept the basic unit of data transfer is a block whose maximum size is defined in the csd (read_bl_len). if read_bl_partial is set, smaller blocks whose starting and ending address are entirely con- tained within one physical block (as defined by read_bl_len) may also be transmitted. unlike stream read, a crc is appended to the end of each block ensuring data transfer integrity. cmd17 (read_single_block) initiates a block read and after completing the transfer, the card returns to the transfer state . cmd18 (read_multiple_block) starts a transfer of severa l consecutive blocks. two types of multiple block read transactions are defined (the host can use either one at any time): ? open-ended multiple block read the number of blocks for the re ad multiple block operation is not defined. the card will continuously transfer data blocks until a stop transmission command is received. ? multiple block read with pre-defined block count the card will transfer the requested number of data blocks, terminate the transaction and return to transfer state. stop command is not required at the end of this type of mu ltiple block read, unless terminated with an error. in order to start a multiple block read with pre-defined block coun t the host must use the set_block_count command (cmd23) immediately preceding the read_multiple_bloc k (cmd18) command. otherwise the card will start an open -ended multiple block read which can be stopped using the stop_transmision command. the host can abort reading at any time, within a multiple block o peration, regardless of the its type. transaction abort is done by sending the stop transmission command. if either one of the following conditions occur, the card will reject the command, remain in tran state and respond with the respective error bit set. ? the host provides an out of range address as an argument to either cmd17 or cmd18. address_out_of_range is set. ? the currently defined block length is ille gal for a read operation. block_len_error is set. ? the address/block-length combination positions the first data block misaligned to the card physical blocks. address_misalign is set. if the card detects an error (e.g. out of range, address misalign ment, internal error, etc.) during a multiple block read oper- ation (both types) it will stop data transmission and remain in the data state. the host must then abort the operation by sending the stop transmission command. the read error is r eported in the response to the stop transmission command. if the host sends a stop transmission command after the card tr ansmits the last block of a multiple block operation with a pre-defined number of blocks, it is regarded as an illegal command, since the card is no longer in data state. if the host uses partial blocks whose accumu lated length is not block aligned, and block misalignment is not allowed, the card shall detect a block misalignment error condition during the transmission of the first misaligned block and the content of the further transferred bits is un defined. as the host sends cmd12 the card will respond with the address_misalign bit set and return to tran state. if the host sets the argument of the set_block_count command (cmd23) to a ll 0s, then the command is accepted; however, a subsequent read will follow the open-ended multip le block read protocol (stop_transmission command - cmd12 - is required).
multimediacard tm 48 sep.22.2005 revision 0.3 6.2.7 data write the data transfer format of write operat ion is similar to the data read. for blo ck oriented write data transfer, the crc check bits are added to each data block. the card performs a crc parity check (see chapter 6.4) for each received data block prior to the write operation. by th is mechanism, writing of erroneously transferred data can be prevented. ? block write during block write (cmd24 - 27) one or more blocks of data are transferred from t he host to the card with a crc appended to the end of each block by the host. a card supporting block write shall always be able to accept a block of data defined by write_bl_len. if the crc fails, the card shall indicate the failure on the dat0 line (see below); the trans- ferred data will be discarded and not written, and all further transmitted blocks (in multiple block write mode) will be ignored. cmd25 (write_multiple_block) starts a transfer of severa l consecutive blocks. two types of multiple block write transactions, identical to the multiple block read, ar e defined (the host can us e either one at any time): ? open-ended multiple block write the number of blocks for the writ e multiple block operation is not defined. the card will continuously accept and pro gram data blocks until a stop transmission command is received. ? multiple block write with pre-defined block count the card will accept the requested number of data blocks, terminate the transaction and return to transfer state. stop command is not required at the end of this type of multip le block write, unless terminated with an error. in order to start a multiple block write with pre-defined block c ount the host must use the set_block_count command (cmd23) immediately preceding the write_multiple_block (cmd25) command. otherwise the card will start an open -ended multiple block write which can be stopped using the stop_transmision command. the host can abort writing at any time, within a multiple block operation, rega rdless of the its type. transaction abort is done by sending the stop transmission command. if a multiple bl ock write with pre-defined blo ck count is aborted, the data in the remaining blocks is not defined. if either one of the following conditions occur, the card will reject the command, remain in tran state and respond with the respective error bit set. ? the host provides an out of range address as an argument to either cmd 24 or cmd25. address_out_of_range is set. ? the currently defined block length is illega l for a write operation. block_len_error is set. ? the address/block-length combination positions the first data block misaligned to the card physical blocks. address_misalign is set. if the card detects an error (e.g. write protect violation, out of range, address misa lignment, internal error, etc.) during a multiple block write operati on (both types) it will ignor e any further incoming data blocks and remain in the receive state. the host must then abort the operation by sending the stop transmission command. the write error is reported in the response to the stop transmission command. if the host sends a stop transmission command after the card re ceived the last data block of a multiple block write with a pre-defined number of blocks, it is regarded as an illegal command, since the card is no longer in data state. if the host uses partial blocks whose accumulated length is not block aligned, and block misalignment is not allowed (csd parameter write_blk_misalign is not set), the card shall de tect the block misalignment error during the reception of the first misaligned block, abort the writ e operation, and ignore all further incomi ng data. as the host sends cmd12, the card will respond with the address _misalign bit set and return to tran state. if the host sets the argument of the set_block_count command (cmd23) to a ll 0s, then the command is accepted; however, a subsequent write will follow t he open-ended multiple block write pr otocol (stop_transmission command - cmd12 - is required).
multimediacard tm 49 sep.22.2005 revision 0.3 programming of the cid and csd registers does not require a previous block lengt h setting. the transferred data is also crc protected. if a part of the csd or cid register is st ored in rom, then this unchangeable part must match the corre- sponding part of the receive buffer. if th is match fails, then the card will report an error and not change any register con- tents. some cards may require long and unpredictable times to write a block of data. after receiving a block of data and complet- ing the crc check, the card will begin writing and hold the dat0 line low if its write buffer is full and unable to accept new data from a new write_block command. the host may poll the status of the card with a send_status command (cmd13) at any time, and the card will respond with its stat us. the status bit ready_for_data indicates whether the card can accept new data or whether the write process is st ill in progress). the host may deselect the card by issuing cmd7 which will displace the card into the disconnect state and release the dat0 line without interrupting the write oper- ation. when reselecting the card, it will reactivate busy indica tion by pulling dat0 to low if programming is still in progress and the write buffer is unavailable. 6.2.8 csd programming programming of the csd register does not require a previous block length setting. after sending cmd27 and receiving an r1 response, the start bit (=0)is sent, the modified csd regi ster (=16 bytes), crc16 (=2bytes) , and end bit (=1). the host can change only the least significant 16bits [15:0] of the csd. the re st of the csd register co ntent must match the multi- mediacard csd register. if the card det ects a content inconsistency between th e old and new csd register, it will not reprogram the csd in order to ensure validity of the crc field in the csd register. bits [7:1] are the crc7 of bits [127:8] of the csd register, which should be recalculated once the register changes. after calculating crc7, the crc16 should also be ca lculated for all of the csd register [127:0].
multimediacard tm 50 sep.22.2005 revision 0.3 6.2.9 erase multimediacards, in addition to the implicit erase executed by the card as part of the write operation, provides a host explicit erase function. the erasable unit of the multimediacard is the ?erase group?; erase group is measured in write blocks which are the basic writable units of the card. the size of the erase group is a card specific parameter and defined in the csd. the content of an explicit ly erased memory range shall be 0. the host can erase a contiguous range of erase groups. starti ng the erase process is a thr ee steps sequence. first the host defines the start address of the range using the erase_group_start (cmd35) command, next it defines the last address of the range using the erase_group_end (cmd36) co mmand and finally it starts the erase process by issu- ing the erase (cmd38) command. the address field in the eras e commands is an erase group address in byte units. the card will ignore all lsb?s below the erase group size, ef fectively rounding the address down to the erase group boundary. if an erase command (either cmd35, cmd36, cmd38) is rece ived out of the defined erase sequence, the card shall set the erase_seq_error bit in the status re gister and reset the whole sequence. if the host provides an out of range address as an argum ent to cmd35 or cmd36, the ca rd will reject the command, respond with the address_out_of_range bi t set and reset the whole erase sequence. if an ?non erase? command (neither of cmd35, cmd36, cmd38 or cmd13) is rece ived, the card shall respond with the erase_reset bit set, reset the erase sequence and execut e the last command. comm ands not addressed to the selected card do not abort the erase sequence. if the erase range includes wr ite protected blocks, th ey shall be left inta ct and only the non protected bl ocks shall be erased. the wp_erase_skip status bit in the status register shall be set. as described above for block write, the card will indicate that an erase is in progress by holding dat0 low. the actual erase time may be quite long, and the host may issue cmd7 to deselect the card. 6.2.10 write protect management in order to allow the host to protect data against erase or writ e, the multimediacard shall suppor t two levels of write protect commands: ? the entire card may be write protec ted by setting the permanent or tempor ary write protect bits in the csd. ? specific segments of the cards ma y be write protected. the segment size is defined in units of wp_grp_size erase groups as specified in the csd. the set_write_prot command sets the wr ite protection of the addressed write-pro tect group, and the clr_write_prot command clears the write protection of the addressed write-protect group. the send_write_prot command is similar to a single block read command. the card shall send a data block contain- ing 32 write protection bits (representing 32 write protect groups starting at the s pecified address) followed by 16 crc bits. the address field in the write protect comm ands is a group address in byte units. the card will ignore all lsb?s below the group size. if the host provides an out of range add ress as an argument to cmd28, cmd29 or cmd30, the card will reject the com- mand, respond with the address_out_of_range bit set and remain in the tran state.
multimediacard tm 51 sep.22.2005 revision 0.3 6.2.11 card lock/unlock operation the password protection feature enables the host to lock the card by providing a password, which later will be used for unlocking the card. the password and its size is kept in an 128 bit pwd and 8 bit pwd_len registers, respectively. these registers are non-volati le so that a power cycle will not erase them. a locked card responds to (and executes) all commands in th e ?basic? command class (class 0) and ?lock card? command class. thus the host is allowed to reset, initialize, select, query fo r status, etc., but not to a ccess data on the card. if th e password was previously set (the value of pwd_len is not ?0?) the card will be locked automatically after power on. similar to the existing csd and cid regist er write commands the lock/unlock command is available in ?transfer state? only. this means that it does not include an address argument and the card has to be selected before using it. the card lock/unlock command has the structure and bus transa ction type of a regular single block write command. the transferred data block includes all the required information of the command (password setting mode, pwd itself, card lock/ unlock etc.). the following table describes the structure of the command data block. table 6-6 : lock card data structure byte # bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 0 reserved erase lock_unlock clr_pwd set_pwd 1 pwd_len 2 password data ... pwd_len + 1 ? erase: ?1? defines forced erase operation (all other bits shall be ?0?) and only the cmd byte is sent. ? lock/unlock : ?1? = locks the card. ?0? = unlock the card (note that it is valid to set this bit together with set_pwd but it is not allowed to set it together with clr_pwd). ? clr_pwd : ?1? = clears pwd. ? set_pwd : ?1? = set new password to pwd ? pwd_len : defines the following password length (in bytes). valid password length are 1 to 16 bytes. ? pwd: the password (new or currently used depending on the command). the data block size shall be defined by the host before it sends the card lock/unlock command. this will allow different password sizes. the following paragraphs define the various lock/unlock command sequences: ? setting th e password ? select the card (cmd7), if not previously selected already ? define the block length (cmd16), given by the 8bit card lock/unlock mode, the 8 bits password size (in bytes), and the number of bytes of the new password. in case that a password replacement is done, then the block size shall consider that both passwords, the old and the new o ne, are sent with the command. ? send card lock/unlock command with the appropriate data block size on the data line including 16 bit crc. the data block shall indicate the mode (set_pwd), the length (pwd_len) and the password itself. in case that a password replacement is done, then the length value (pwd_len) shall include both passwords, the old and the new one, and the pwd field shall include the old password (currently used) followed by the new pass word. ? in case that a password replacement is attempted wit h pwd_len set to the length of the old pass-word only, the lock_unlock_failed error bit is set in the status register and the old password is not changed. ? in case that the sent old password is not correct ( not equal in size and content) then lock_unlock_failed error bit will be set in the status register and the old password does not change. in case that pwd matches the sent old password then the given new password and its size will be saved in the pwd and pwd_len fields, respectively.
multimediacard tm 52 sep.22.2005 revision 0.3 note that the password length register (pwd_len) indicates if a password is currently set. when it equals ?0? there is no password set. if the value of pwd_len is not equal to zero the ca rd will lock itself after power up. it is possible to lock the card immediately in the current power session by setting the lock/unlock bit (while setting the password) or sending additional command for card lock. ? reset the password: ? select the card (cmd7), if not previously selected already ? define the block length (cmd16), given by the 8 bit card lock/unlock mode, the 8 bit password size (in bytes), and the number of bytes of the currently used password. ? send the card lock/unlock command with the appropriate data block size on the data line including 16 bit crc. the data block shall indicate the mode clr_pwd, the length (pwd_len) and the password (pwd) itself (lock/ unlock bit is don?t care). if the pwd and pw d_len content match the sent pa ssword and its size, then the con tent of the pwd register is cleared and pwd_len is set to 0. if the password is not correct then the lock_unlock_failed error bit will be set in the status register. ? locking a card: ? select the card (cmd7), if not previously selected already ? define the block length (cmd16), given by the 8 bit ca rd lock/unlock mode, the 8 bit password size (in bytes), and the number of bytes of the currently used password. ? send the card lock/unlock command with the appropriate da ta block size on the data line including 16 bit crc. the data block shall indicate the mode lock, the length (pwd_len) a nd the password (pwd) itself. if the pwd content equals to the sent password then the card will be locked and the card-locked status bit will be set in the status register. if the password is not correct then lock_u nlock_failed error bit will be set in the status register. note that it is possible to set the password and to lock the ca rd in the same sequence. in such case the host shall perform all the required steps for setting the password (as described above) including the bit lock set while the new password command is sent. if the password was previously set (pwd_len is not ?0?), then the card will be locked automatically after power on reset. an attempt to lock a locked card or to lock a card that does not have a password will fail and the lock_unlock_failed error bit will be set in the status register. ? unlocking the card: ? select the card (cmd7), if not previously selected already. ? define the block length (cmd16), given by the 8 bit card lock/unlock mode, the 8 bit password size (in bytes), and the number of bytes of the currently used password. ? send the card lock/unlock command with the appropriate data block size on the data line including 16 bit crc. the data block shall indicate the mode un lock, the length (pwd_len) an d the password (pwd) itself. if the pwd content equals to the sent password then the ca rd will be unlocked and the card-locked status bit will be cleared in the status register. if the password is not corre ct then the lock_unlock_failed error bit will be set in the status register. note that the unlocking is done only for the current power se ssion. as long as the pwd is not cleared the card will be locked automatically on the next power up. the only way to unlock the card is by clearing the password. an attempt to unlock an unlocked card will fail and lock_unl ock_failed error bit will be set in the status register.
multimediacard tm 53 sep.22.2005 revision 0.3 ? forcing erase: in case that the user forgot the password (the pwd content) it is possible to eras e all the card data content along with the pwd content. this operation is called forced erase . ? select the card (cmd7), if not previously selected already. ? define the block length (cmd16) to 1 byte (8bit ca rd lock/unlock command). send the card lock/unlock command with the appropriate data block of one byte on the data line including 16 bit crc. the data block shall indicate t he mode erase (the erase bit shall be the only bit set). if the erase bit is not the only bit in the data fi eld then the lock_unlock_failed error bit will be set in the status reg- ister and the erase request is rejected. if the command was accepted then all the card cont ent will be erased including the pwd and pwd_len register content and the locked card will get unlocked. in additi on, if the card is temporary write protected it will be unpro- tected (write enabled), the temporary- write-protect bit in the csd and all write-protect-groups will be cleared. an attempt to force erase on an unlocked card will fail and lock_unlock_failed error bit will be set in the status reg- ister. if a force erase command is issued on a permanently-write-p rotect media the command will fail (card stays locked) and the lock_unlock_failed error bit will be set in the status register. the force erase time-out is specified in chapter 6.5.2
multimediacard tm 54 sep.22.2005 revision 0.3 6.3 clock control the multimediacard bus clock signal can be used by the host to put the card into energy saving mode, or to control the data flow (to avoid under-run or over-run conditions) on the bus . the host is allowed to lower the clock frequency or shut it down. there are a few restrictions the host must follow: ? the bus frequency can be changed at any time (under the restrictions of maximum data transfer frequency, defined by the card, and the identification frequency defined by the specification document). ? it is an obvious requirement that the clock must be running for the card to output data or response tokens. after the last multimediacard bus trans action, the host is required, to provide 8 (eight) clock cycles for the ca rd to complete the operation before shutting down the clock. following is a list of the various bus transactions: ? a command with no response. 8 clocks after the host command end bit. ? a command with response. 8 cl ocks after the card response end bit. ? a read data transaction. 8 clocks after the end bit of the last data block. ? a write data transaction. 8 clocks after the crc status token. ? the host is allowed to shut down the clock of a ?busy? card. the card will complete the programming operation regardless of the host clock. however, the host must provide a clock edge for the card to turn off its busy signal. without a clock edge the card (unless previously disconnected by a deselect command -cmd7) will force the dat0 line down, forever. 6.4 cyclic redundancy codes (crc) the crc is intended for protecting mult imediacard commands, responses and data transfer against transmission errors on the multimediacard bus. one crc is generated for every co mmand and checked for every response on the cmd line. for data blocks one crc per transferred block, per data li ne, is generated. the crc is generated and checked as described in the following. ? crc7 the crc7 check is used for all commands, for all responses except type r3, and for the csd and cid registers. the crc7 is a 7-bit value and is computed as follows: generator polynomial all crc registers are initialized to zero. the first bit is th e most left bit of the corresponding bit string (of the command, response, cid or csd). the degree n of the polynomial is the nu mber of crc protected bits decreased by one. the num- ber of bits to be protected is 40 for commands and resp onses (n = 39), and 120 for the csd and cid (n = 119). figure 6-3 : crc7 generator/checker gx () x 7 x 3 1 ++ = mx () first bit () x n second bit () x n 1 ? last bit () x 0 ++ + = crc 6 0 [] remainder mx () x 7 ? () gx () ? [] = data in data out
multimediacard tm 55 sep.22.2005 revision 0.3 ? crc16 the crc16 is used for payload protection in block transfer mode. the crc check su m is a 16-bit value and is computed as follows: generator polynomial all crc registers are initialized to zero. the first bit is the first data bit of the corresponding block. the degree n of the polynomial denotes the number of bits of the data block decreased by one (e.g . n = 4095 for a block length of 512 bytes). the generator polynomial is a standard ccitt polynomial. the code has a minimal distance d=4 and is used for a payload length of up to 2048 bytes (n <= 16383). the same crc16 calculation is used for a ll bus configurations. in 4 bit and 8 bi t bus configurations, the crc16 is calcu- lated for each line separately. sending the crc is synchronize d so the crc code is transferred at the same time in all lines. figure 6-4 : crc16 generator/checker gx () x 16 x 12 x 5 1 +++ = mx () first bit () x n second bit () x n 1 ? last bit () x 0 ++ + = crc 15 0 [] remainder mx () x 16 ? () gx () ? [] = gx () data in data out
multimediacard tm 56 sep.22.2005 revision 0.3 6.5 error conditions 6.5.1 crc and illegal command all commands are protected by crc (cyclic redundancy check) bits. if the addressed card?s crc check fails, the card does not respond, and the command is not executed; the card does not change its state, and com_crc_error bit is set in the status register. similarly, if an illegal command has been received, the card shall not change its state, shall not respond and shall set the illegal_command error bit in the status register. only th e non-erroneous state branches are shown in the state dia- grams (see figure 6-1 to figure 6-2 ). table 6-18 contains a complete state transition description. there are different kinds of illegal commands: ? commands which belong to classes not suppor ted by the card (e.g. write commands in read only cards). ? commands not allowed in the current state (e.g. cmd2 in transfer state). ? commands which are not defined (e.g. cmd44). 6.5.2 read, write, erase and force erase time-out conditions the times after which a time-out condition for read/ write/erase operations oc curs are (card independent) 10 times longer than the typical access/program times for these operations given below. a card shall complete the command within this time period, or give up and return an error message. if the host does not get a response wi thin the defined time-out it should assume the card is not going to respond anymore and tr y to recover (e.g. reset the ca rd, power cycle, reject, etc.). the typical access and program times are defined as follows: ? read the read access time is defined as the sum of the two time s given by the csd parameters taac and nsac (see chapter 6.11). these card parameters define the typical delay betw een the end bit of the read command and the start bit of the data block. ? write the r2w_factor field in the csd is used to calculate the ty pical block program time obtained by multiplying the read access time by this factor. it applies to all wr ite/erase commands (e.g. set(clear)_write_protect, program_csd(cid) and the block write commands). ? erase the duration of an erase comma nd will be (order of magnitude) the number of write blocks to be erased multiplied by the block write delay. ? force erase the duration of the force erase command using cmd42 is specified to be a fixed time-out of 3 minutes. 6.6 minimum performance a mmcplus and mmcmobile card has to fullfill the r equirements set for the read and write access performance. 6.6.1 speed class definition the speed class definition is for indication of the minimu m performance of a card. the classes are defined based on the 150kb/s base value. the minimum performance of the card can then be marked by defined multiples of the base value e.g. 2.4mb/s. only following speed classes are defined (n ote that mmcplus and mmcmobile cards are always including 8bit data bus and the categories below states th e configuration with which the card is operated):
multimediacard tm 57 sep.22.2005 revision 0.3 low bus category classes (26mhz clock with 4bit data bus operation) ? 2.4 mb/s class a ? 3.0 mb/s class b ? 4.5 mb/s class c ? 6.0 mb/s class d ? 9.0 mb/s class e mid bus category classes (26mhz clock with 8bit data bus or 52mhz clock with 4bit data bus operation): ? 12.0 mb/s class f ? 15.0 mb/s class g ? 18.0 mb/s class h ? 21.0 mb/s class j high bus category classes (52mhz cl ock with 8bit data bus operation): ? 24.0 mb/s class k ? 30.0 mb/s class m ? 36.0 mb/s class o ? 42.0 mb/s class r ? 48.0 mb/s class t the performance values for both write and read accesses are stor ed into the ext_csd register for electrical reading (see chapter 5.5.4 on page 32). only the defined values and classes are allowed to be used. 6.6.2 absolute minimum absolute minimum read and write access performance which al l mmcplus and mmcmobile cards has to fullfill is 2.4mb/s. this is the class a. 6.6.3 measurement of the performance the procedure for the measurement of the performance of the card is defined in detail in the compliance documentation. initial state of the memory in prior to the test is: filled with random data. the test is performed by writing/reading a 64kb chunk of data to/from random logical addresses (aligned to physical block boundaries)of the card. a predefined multiple block write/read is used with block count of 128 (64kb as 512 b blocks are used). the performance is calculated as aver- age out of several 64kb accesses. same test is performed with all applicable clock frequency and bus width options as follows: ? 52mhz, 8bit bus (if 52mhz clock frequency is supported by the card) ? 52mhz, 4bit bus (if 52mhz clock frequency is supported by the card) ? 26mhz, 8bit bus ? 26mhz, 4bit bus in case the minimum performance of the card exceeds the physi cal limit of one of the above mentioned options the card has to also fulfill accordingly the performance criteria as defined in min_perf_a_b_ff in chapter 5.5.4 on page 32
multimediacard tm 58 sep.22.2005 revision 0.3 6.7 commands 6.7.1 command types there are four kinds of commands def ined to control the multimediacard: * broadcast commands (bc), no response * broadcast commands with response (bcr) * addressed (point-to-point) commands (ac), no data transfer on dat lines * addressed (point-to-point) data tr ansfer commands (adtc), data transfer on dat lines * all commands and responses are sent over th e cmd line of the multimediacard bus. the command transmission always starts with the left bit of the bitstring corresponding to the command codeword. 6.7.2 command format all commands have a fixed code length of 48 bits, needi ng a transmission time of 0.92 microsec @ 52 mhz a command always starts with a start bit (always ?0?), followed by the bit indicating the direction of transmission (host = ?1? ). the next 6 bits indicate the index of the command, this val ue being interpreted as a binary coded number (between 0 and 63). some commands need an argument (e.g. an address), which is coded by 32 bits. a value denoted by ?x? in the table above indicates this variable is dependent on the command. all commands are protected by a crc (see chapter 6.4 for the definition of crc7). every command codeword is termi nated by the end bit (always ?1?). all commands and their argu- ments are listed in table 6-9 -table 6-17. 6.7.3 command classes the command set of the multimediacard syst em is divided into several classes (see table 6-8). each class supports a subset of card functions. class 0 is mandatory and shall be supported by all cards. t he other classes are either man datory only for specific card types or optional. the supported card command classes (ccc) are coded as a parameter in the card specific data (csd) register of each card, providing the host with information on how to access the card. bit position 47 46 [45:40] [39:8] [7:1] 0 width (bits) 1 1 6 32 7 1 value ?0? ?1? x x x ?1? description start bit transmission bit command index argument crc7 end bit table 6-7 : format (0.92us @52mhz)
multimediacard tm 59 sep.22.2005 revision 0.3 6.7.4 detailed command description the following tables define in detail all multimediacard bus commands. the responses r1-r5 are defined in chapter 6.8. the registers cid, csd, ext_csd an d dsr are described in chapter 5.5. card com- mand class (ccc) class description supported commands 0 1 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 23 24 25 26 27 class 0 basic ++++++++++ ++++ + class 1 stream read + class 2 block read + + + + class 3 stream write + class 4 block write + + + + + + class 5 erase class 6 write protection class 7 lock card + class 8 application specific class 9 i/o mode class 10-11 reserved card com- mand class (ccc) class description supported commands 28 29 30 35 36 38 39 40 42 55 56 class 0 basic class 1 stream read class 2 block read class 3 stream write class 4 block write class 5 erase + + + class 6 write protection + + + class 7 lock card + class 8 application specific + + class 9 i/o mode + + class 10-11 reserved table 6-8 : card command classes (cccs)
multimediacard tm 60 sep.22.2005 revision 0.3 cmd index type argument resp abbreviation command description cmd0 bc [31:0] stuff bits - go_idle_state resets the card to idle state cmd1 bcr [31:0] ocr without busy r3 send_op_cond asks the card, in id le state, to send its oper- ating conditions register contents in the response on the cmd line. cmd2 bcr [31:0] stuff bits r2 a ll_send_cid asks the card to se nd its cid number on the cmd line cmd3 ac [31:16] rca [15:0] stuff bits r1 set_relative_addr assigns re lative address to the card cmd4 not supported cmd5 reserved cmd6 ac [31:26] set to 0 [25:24] access [23:16] index [15:8] value [7:3] set to 0 [2:0] cmd set r1b switch switches the mode of operation of the selected card or modifies the ext_csd reg- isters. (see chapter 6.2.1) cmd7 ac [31:16] rca [15:0] stuff bits r1b a a. only from the selected card select/ deselect_card command toggles a card between the stand-by and transfer states or between the programming and disconnect states. in both cases the card is selected by its own relative address and gets deselected by any other address; address 0 deselects the card. cmd8 adtc [31:0] stuff bits r1 send_ext_csd the card sends its ext_csd register as a block of data. cmd9 ac [31:16] rca [15:0] stuff bits r2 send_csd addressed card send s its card-specific data (csd) on the cmd line. cmd10 ac [31:16] rca [15:0] stuff bits r2 send_cid addressed card sends its card identification (cid) on cmd the line. cmd11 not supported cmd12 ac [31:0] stuff bits r1b stop_transmission forces the card to stop transmission cmd13 ac [31:16] rca [15:0] stuff bits r1 send_status addressed card sends its status register. cmd14 adtc [31:0] stuff bits r1 bustest_r a host reads the reversed bus testing data pattern from a card. cmd15 ac [31:16] rca [15:0] stuff bits - go_inactive_state sets the card to inactive state cmd19 adtc [31:0] stuff bits r1 bustest_w a host sends the bus test data pattern to a card. table 6-9 : basic commands and read stream commands (class 0 and class 1)
multimediacard tm 61 sep.22.2005 revision 0.3 cmd index type argument resp abbreviation command description cmd16 ac [31:0] block length r1 set_blocklen sets the block length (in bytes) for all following block commands (read and write). default block length is specified in the csd. cmd17 adtc [31:0] data address r1 read_single_block reads a block of the size selected by the set_blocklen command. a a.the transferred data must not cross a physical block boundary, un less read_blk_misalign is set in the csd register cmd18 adtc [31:0] data address r1 read_multiple_b lock continuously transfers data blocks from card to host until interrupted by a stop command, or the requested number of data blocks is transmitted table 6-10 : block oriented read commands (class 2) cmd index type argument resp abbreviation command description cmd20 not supported cmd21 ... cmd22 reserved table 6-11 : stream write commands (class 3)
multimediacard tm 62 sep.22.2005 revision 0.3 cmd index type argument resp abbreviation command description cmd23 ac [31:16] set to 0 [15:0] number of blocks r1 set_block_count defines the nu mber of blocks which are going to be transferred in the immediately succeeding multiple block read or write command. if the argument is all 0s, the subsequent read/ write operation will be open-ended. cmd24 adtc [31:0] data address r1 write_block writes a block of the size selected by the set_blocklen command. a a.the transferred data must not cro ss a physical block boundary unless write_blk_misali gn is set in the csd cmd25 adtc [31:0] data address r1 write_multiple_bl ock continuously writes blocks of data until a stop_transmission follows or the requested number of block received. cmd26 not applicable cmd27 adtc [31:0] stuff bits r1 program_csd pr ogramming of the programmable bits of the csd. table 6-12 : block oriented write commands (class 4) cmd index type argument resp abbreviation command description cmd28 ac [31:0] data address r1b set_write_prot if the card has write protection features, this command sets the write protection bit of the addressed group. the properties of write pro- tection are coded in the card specific data (wp_grp_size). cmd29 ac [31:0] data address r1b clr_write_prot if th e card provides write protection features, this command clears the write protection bit of the addressed group. cmd30 adtc [31:0] write protect data address r1 send_write_prot if the card prov ides write protection features, this command asks the ca rd to send the status of the write protection bits. a a. 32 write protection bits (represe nting 32 write protect groups star ting at the specified address) followed by 16 crc bits are t rans- ferred in a payload format via the data li nes. the last (least significant) bit of the protecti on bits corresponds to the first addressed group. if the addresses of the last groups are outside the vali d range, then the corresponding wr ite protection bits shall be s et to zero. cmd31 reserved table 6-13 : block oriented write protection commands (class 6)
multimediacard tm 63 sep.22.2005 revision 0.3 cmd index type argument resp abbreviation command description cmd32 ... cmd34 reserved. these command indexes cannot be used in order to mainta in backwards compatibility with older versions of the multimediacards cmd35 ac [31:0] data address r1 erase_group_start sets the address of the first erase group within a range to be selected for erase cmd36 ac [31:0] data address r1 erase_group_end sets the address of the last erase group within a continuous range to be selected for erase cmd37 reserved. this command index cannot be used in order to mainta in backwards compatibility wit h older versions of the multimediacards cmd38 ac [31:0] stuff bits r1b erase erases all previously selected write blocks table 6-14 : erase commands (class 5) cmd index type argument resp abbreviation command description cmd39 cmd40 mmca optional command, currently not supported. cmd41 reserved table 6-15 : i/o mode commands (class 9) cmd index type argument resp abbreviation command description cmd42 adtc [31:0] stuff bits. r1b lock_unlock used to set/reset the passw ord or lock/unlock the card. the size of the data block is set by the set_block_len command. cmd43... cmd54 reserved table 6-16 : lock card (class 7)
multimediacard tm 64 sep.22.2005 revision 0.3 all future reserved commands shall have a codeword length of 48 bits, as well as their responses (if there are any). cmd index type argument resp abbreviation command description cmd55 cmd56 mmca optional command, currently not supported. cmd57 ... cmd59 reserved cmd60 ... cmd63 reserved for manufacturer table 6-17 : application specific commands (class 8)
multimediacard tm 65 sep.22.2005 revision 0.3 6.8 card state transition table defines the card state transitions in dependency of the received command. current state idle ready ident stby tran data btst rcv prg dis ina irq command changes to class independent crc error - - - - - - - - - - - stby command not supported - - - - - - - - - - - stby class 0 cmd0 idle idle idle idle idle idle idle idle idle idle - stby cmd1, card v dd range compatible ready - - - - - - - - - - stby cmd1, card is busy idle - - - - - - - - - - stby cmd1, card v dd range not compatible ina - - - - - - - - - - stby cmd2, card wins bus - ident - - - - - - - - - stby cmd2, card loses bus - ready - - - - - - - - - stby cmd3 - - stby - - - - - - - - stby cmd4 - - - stby - - - - - - - stby cmd6 - - - - prg - - - - - - stby cmd7, card is addressed - - - tran - - - - - prg - stby cmd7, card is not addressed - - - - stby stby - - dis - - stby cmd8 - - - - data - - - - - - stby cmd9 - - - stby - - - - - - - stby cmd10 - - - stby - - - - - - - stby cmd12 - - - - - tran - prg - - - stby cmd13 - - - stby tran data btst rcv prg dis - stby cmd14 - - - - - - tran - - - - stby cmd15 - - - ina ina ina ina ina ina ina - stby cmd19 - - - - btst - - - - - - stby class 1 cmd11 - - - - data - - - - - - stby class 2 cmd16 - - - - tran - - - - - - stby cmd17 - - - - data - - - - - - stby cmd18 - - - - data - - - - - - stby cmd23 - - - - tran - - - - - - stby table 6-18 : card state transition table
multimediacard tm 66 sep.22.2005 revision 0.3 6.9 responses all responses are sent via the command line cmd. the response transmission always star ts with the left bit of the bitstring corresponding to the response codeword. the code length depends on the response type. a response always starts with a start bit (always ?0?), followed by the bit indicating the direction of transmission (card = ?0 ?). a value denoted by ?x? in the tables below indicates a variable entry. all responses except fo r the type r3 (see below) are protected by a crc (see chapter 7.2 for the definition of crc7 ). every command codeword is terminated by the end bit (always ?1?). current state idle ready ident stby tran data btst rcv prg dis ina irp class 3 cmd20 - ---rcv------stby class 4 cmd16 see class 2 cmd23 see class 2 cmd24 - - - - rcv - - - rcv - - stby cmd25 - - - - rcv - - - rcv - - stby cmd26 - ---rcv------stby cmd27 - ---rcv------stby class 6 cmd28 - ---prg------stby cmd29 - ---prg------stby cmd30 - ---data------stby class 5 cmd35 - ---tran------stby cmd36 - ---tran------stby cmd38 - ---prg------stby class 7 cmd16 see class 2 cmd42 - ---rcv------stby class 8 cmd55 - - - stby tran data btst rcv prg dis - irq cmd56; rd/wr = 0 - ---rcv------stby cmd56; rd/wr = 1 - ---data------stby class 9 cmd39 cmd40 mmca optional command, currently not supported class 10 - 11 cmd41; cmd43...cmd54, cmd57-cmd59 reserved cmd60...cmd63 reserved for manufacturer table 6-18 : card state transition table
multimediacard tm 67 sep.22.2005 revision 0.3 there are five types of responses. their formats are defined as follows: ? r1 (normal response command): code length 48 bit. the bits 45:40 indicate the index of the command to be responded to, this value being interpreted as a binary coded number (betwe en 0 and 63). the status of the card is coded in 32 bits. the card status is described in chapter ? r1b is identical to r1 with an optional busy signal transmitted on the data line dat0. the card may become busy after receiving these commands based on its state prior to the comm and reception. refer to section for detailed description and timing diagrams. ? r2 (cid, csd register): code length 136 bits. the contents of the cid register are sent as a response to the commands cmd2 and cmd10. the contents of the csd regi ster are sent as a response to cmd9. only the bits [127...1] of the cid and csd are transferred, the reserved bit [0] of thes e registers is replaced by the end bit of the response. ? r3 (ocr register): code length 48 bits. the contents of the ocr register is sent as a response to cmd1. the level cod- ing is as follows: restricted voltage windows=low, card busy=low. ? r4 and r5 : responses are not supported. bit position 47 46 [45:40] [39:8] [7:1] 0 width (bits) 1 1 6 32 7 1 value ?0? ?0? x x x ?1? description start bit transmission bit command index card status crc7 end bit bit position 135 134 [133:128] [127:1] 0 width (bits) 1 1 6 127 1 value ?0? ?0? ?111111? x ?1? description start bit transmission bit check bits cid or csd register incl. inter- nal crc7 end bit bit position 47 46 [45:40] [39:8] [7:1] 0 width (bits) 1 1 6 32 7 1 value ?0? ?0? ?111111? x ?1111111? ?1? description start bit transmission bit check bits ocr register check bits end bit table 6-19 : response r1 table 6-20 : response r2 table 6-21 : response r3
multimediacard tm 68 sep.22.2005 revision 0.3 6.10 card status the response format r1 contains a 32-bit field named card status . this field is intended to transmit the card?s status infor- mation. three different attributes are associated with each one of the card status bits: ? bit type. two types of card status bits are defined: (a) error bit . signals an error condition detected by the card. these bits are cleared as soon as the response (reporting the error) is sent out. (b) status bit . these bits serve as information fields only, and do not alter the execution of the command being responded to. these bits are set and cleared in accordance with the card status. the ?type? field of table 6-22 defines the type of each bit in the card status register. the symbol ?e? is used to denote an error bit while the symbol ?s? is used to denote a status bit. ? detection mode of error bits. exceptions are detected by the card either during the comm and interpretation and validation phase (response mode) or during command execution phase (execution mode). response mode exceptions are reported in the response to a stop_transmission command used to terminate the operation or in the response to a get_status command issued after the operation is completed. the ?det mode? field of table 6-22 defines the detection mode of each bit in the card status register. the symbol ?r? is used to denote a response mode detection while the symbol ?x? is used to denote an execution mode detection. when an error bit is detected in ?r? mode the card will report the error in the response to the command that raised the exception. the command will not be executed and the associated state transition will not take place. when an error is detected in ?x? mode the execution is terminated. the error will be reported in the response to the next command. the address_out_of_range and addr ess_misalign exceptions may be de tected both in response and exe- cution modes. the conditions for each one of t he modes are explicitly defined in the table 6-22. ? clear condition: a - according to the card current state b - always related to the previous command. reception of a valid command will clear it (with a delay of one command) c - clear by read.
multimediacard tm 69 sep.22.2005 revision 0.3 bits identifier type det- mode value descript clear cond 31 address_ out_of_range e r ?0?= no error ?1?= error the command?s address argument was out of the allowed range for this card. c x a multiple block or stream read/write opera- tion is (although started in a valid address) attempting to read or write beyond the card capacity 30 address_misalig n e r ?0?= no error ?1?= error the command? s address argument (in accordance with the currently set block length) positions the first data block mis- aligned to the card physical blocks. c x a multiple block read/write operation (although started with a valid address/block- length combination) is attempting to read or write a data block which does not align with the physical blo cks of the card. 29 block_len_erro r e r ?0?= no error ?1?= error either the argument of a set_blocklen command exceeds the maximum value allowed for the card, or the previously defined block length is illegal for the current command (e.g. the host issues a write com- mand, the current block length is smaller than the card?s maxi mum and write partial blocks is not allowed) c 28 erase_seq_erro r e r ?0?= no error ?1?= error an error in the sequence of erase commands occurred. c 27 erase_param e x ?0?= no error ?1?= error an invalid selection of erase groups for erase occurred. c 26 wp_violation e x ?0?= no error ?1?= error attempt to program a write protected block. c 25 card_is_locked s r ?0? = card unlocked ?1? = card locked when set, signals that the card is locked by the host a 24 lock_unlock_ failed e x ?0? = no error ?1? = error set when a sequence or password error has been detected in lo ck/unlock card command c 23 com_crc_error e r ?0?= no error ?1?= error the crc check of the previous command failed. b 22 illegal_command e r ?0?= no error ?1?= error command not legal for the card state b 21 card_ecc_failed e x ?0?= success ?1?= failure card internal ecc was applied but failed to correct the data. c 20 cc_error e r ?0?= no error ?1?= error (undefined by the standard) a card error occurred, wh ich is not related to the host command. c table 6-22 : card status
multimediacard tm 70 sep.22.2005 revision 0.3 bits identifier type det- mode value description clear cond 19 error e x ?0?= no error ?1?= error (undefined by the standard) a generic card error related to the (and detected during) execut ion of the last host command (e.g. read or write failures). c 18 - 17 not applicable. this bit is always set to 0. 16 cid/ csd_overwrite e x ?0?= no error ?1?= error can be either one of the following errors: - the cid register has been already written and can not be overwritten - the read only section of the csd does not match the card content. - an attempt to reverse the copy (set as origi- nal) or permanent wp (unprotected) bits was made. c 15 wp_erase_skip e x ?0?= not protected ?1?= protected only partial address space was erased due to existing write protected blocks. c 14 reserved, must be set to 0 13 erase_reset e r ?0?= cleared ?1?= set an erase sequence was cleared before exe- cuting because an out of erase sequence command was received (commands other than cmd35, cmd36, cmd38 or cmd13 c 12:9 current_state s r 0 = idle 1 = ready 2 = ident 3 = stby 4 = tran 5 = data 6 = rcv 7 = prg 8 = dis 9 = btst 10-15 = reserved the state of the card when receiving the com- mand. if the command execution causes a state change, it will be visible to the host in the response on the next command. the four bits are interpreted as a binary num- ber between 0 and 15. b 8 ready_for_data s r ?0?= not ready ?1?= ready corresponds to buffer empty signalling on the bus a 7 switch_error e x ?0?= no error ?1?= switch error if set, the card did not switch to the expected mode as requested by the switch com- mand c 6 reserved 5 not applicable. this bit is always set to 0. 4 reserved 3:2 reserved for application specific commands 1:0 reserved for manufacturer test mode table 6-22 : card status
multimediacard tm 71 sep.22.2005 revision 0.3 6.11 memory array partitioning the basic unit of data transfer to/from the multimediacard is one byte. all data transfer operations which require a block size always define block lengths as integer multiples of byte s. some special functions need other partition granularity. for block oriented commands, the following definition is used: ? block : is the unit which is related to the block oriented read and write commands. its size is the number of bytes which will be transferred when one block command is sent by the host. the size of a block is either programmable or fixed. the information about allowed block sizes and the programmability is stored in the csd. for r/w cards, special erase and write protect commands are defined: the granularity of the erasable units is the erase group: the smallest number of consecutive write blocks which can be addressed for erase. the size of the erase gr oup is card specific and stored in the csd. the granularity of the writ e protected units is the wp-group: the minimal unit which may be individually write protected. its size is defined in units of erase groups. the size of a wp-group is card sp ecific and stored in the csd. multimediacard write protect group 1 erase group 0 erase group 1 write block 1 write block n write block 3 write block 2 write block 0 erase group 2 erase group n erase group 3 write protect group 0 write protect group 2 write protect group n figure 6-5 : memory array partitioning
multimediacard tm 72 sep.22.2005 revision 0.3 6.12 timing diagrams all timing diagrams use the following schematics and abbreviations: the difference between the p-bit and z-bit is that a p-bit is actively driven to high by the card respectively host output driver, while z-bit is driven to (respectively kept) high by the pull-up resistors r cmd respectively r dat . actively-driven p- bits are less sensitive to noise. all timing values are defined in table 6-25. 6.12.1 command and response both host command and card response are clocke d out with the rising edge of the host clock. ? card identification and card operation conditions timing the card identification (cmd2) and card operation conditions (cmd1) timing are processed in the open-drain mode. the card response to th e host command starts after exactly n id clock cycles. figure 6-7 : identification timi ng (card identi fication mode) ? assign a card relative address the set_rca (cmd 3) is also processed in the open-drain mode. the minimum delay between the host command and card response is n cr clock cycles. figure 6-8 : set_rca timing (card identification mode) symbol definition s start bit (= ?0?) t transmitter bit (host = ?1?, card = ?0?) p one-cycle pull-up (= ?1?) e end bit (=?1?) z high impedance state (-> = ?1?) x driven value, ?1? or ?0? d data bits * repetition crc cyclic redundancy check bits (7 bits) card active host active table 6-24 : timing diagram symbols ?? host command ?? n id cycles ? ? cid or ocr ?? cmd s t content crc e z * * * z s t content z z z ?? host command ?? ? n cr cycles ? ?? response ??? cmd s t content crc e z * * * z s t content crc ez z z
multimediacard tm 73 sep.22.2005 revision 0.3 ? data transfer mode. after a card receives its rca it will switch to data transfer mode. in this mode the cmd line is driven with push-pull drivers. the command is followed by a period of two z bits (allowing ti me for direction switching on the bus) and than by p bits pushed up by the responding card. this timing diagram is relevant for all responded host commands except cmd1,2,3: figure 6-9 : command response timing (data transfer mode) ? r1b responses some commands, like cmd6, may assert the busy signal after responding with r1. if the busy signal is asserted, it is done two clock cycles after the end bit of the command. the dat0 line is driven low, dat1-dat7 lines are driven by the card though their value is not relevant. figure 6-10 : r1b response timing ? last card response - next host command timing after receiving the last card response, the host can start the next command transmission after at least n rc clock cycles. this timing is relevant for any host command. figure 6-11 : timing response end to next command start (data transfer mode) ? last host command - next host command timing after the last command has been s ent, the host can cont inue sending the next command after at least n cc clock periods. if the all_send_cid command is not responded by the card after n id + 1 clock periods, the host can conclude there is no card present in the bus. figure 6-12 : timing of command sequences (all modes) ?? host command ?? ? n cr cycles ? ?? response ??? cmd s t content crc ez z p * * * p s t content crc ez z z ?? host command ?? cmd s t content crc ez zzzz * * * * * * * * * * * * * * * * * * * * zzzzz n st ???????? card is busy ??????? dat0 zzzzzzzzzzz z s l * * * * * * * * * * * * * * * * * * * * * * ezzz dat1-7 zzzzzzzzzzz z x * * * * * * * * * * * * * * * * * * * * * * * * xzzz ??? response ??? ? n cr cycles ? ?? host command ?? cmd s t content crc e z * * * z s t content crc ez z ?? host command ?? ? n cc cycles ? ?? host command ?? cmd s t content crc e z * * * z s t content crc ez z
multimediacard tm 74 sep.22.2005 revision 0.3 6.13 data read ? single block read the host selects one card for data read operation by cmd7, and sets the valid block length for block oriented data transfer by cmd16. the basic bus timing for a read operation is given in figure 6-12. the sequence starts with a single block read command (cmd17) which specifies the start address in the ar gument field. the response is sent on the cmd line as usual. figure 6-12 : single block read timing data transmission from the card st arts after the access time delay n ac beginning from the end bit of the read command. after the last data bit, the crc check bits are suffixed to allow the host to check for transmission errors. ? multiple block read in multiple block read mode, the card sends a continuous flow of data blocks following the initial host read command. the data flow is terminated by a stop tran smission command (cmd12). figure 6-13 descr ibes the timing of the data blocks and figure 6-14 the response to a stop command. the data trans mission stops two clock cycles after the end bit of the stop command. figure 6-13 : multiple block read timing figure 6-14 : stop command timing (cmd12, data transfer mode) ?? host command ?? ? n cr cycles ? ?? response ??? cmd s t content crc ez z p * * * p s t content crc e ??? n ac cycles ??? ?? read data dat0-7 zzz * * * * zzzzz z p * * * * * * * * * * p s d d d * * * ? host command ?? n cr cycles ? ??? response ?? cmd s t content crc ez z p * * p s t content crc ezz p p * * * * * * p p p p p p ??? n ac cycles ?? ??? read data ?? ? n ac cycles ? read data dat0-7 z z z * * * * * z z z z p * * * * * * * p s d d d * * * * d e p * * * * * * p s d d d d ??? host command ?? ?? n cr cycles ? ???? response ????? cmd s t content crc ez z p * * * p s t content crc e n st dat0-7 d d d * * * * * * * * d d d e z z * * * * * * * * * * * * * * * * * * * * ??? valid read data ????
multimediacard tm 75 sep.22.2005 revision 0.3 6.14 data write ? single block write the host selects the card for data write operation by cmd7. the host sets the valid block length for block oriented data tr ansfer (a stream write mode is also available) by cmd16. the basic bus timing for a write operation is given in figur e 6-15. the sequence starts with a single block write command (cmd24) which determines (in the argument field) the start address. it is responded by the card on the cmd line as usual. the data transfer from the host starts n wr clock cycles after the card response was received. the data is suffixed with crc check bits to allow the card to check it for transmission errors. the card sends back the crc check result as a crc status token on dat0. in the case of transmission error, occurring on any of the active data lines, the card sends a negative crc status (?101?) on dat0. in the case of successful transmission, over all active data lines, the card sends a positive crc status (?010?) on dat0 and starts the data programming procedure figure 6-15 : block write command timing if the card does not have a free data receive buffer, the card indicates this condition by pulling down the data line dat0 to low. the card stops pulling down dat0 as soon as at least one receive buffer for the defined data transfer block length becomes free. this signalling does not give any information abo ut the data write status which must be polled by the host. ? multiple block write in multiple block write mode, the card expects continuous fl ow of data blocks following th e initial host write command. the data flow is terminated by a stop transmission command (cmd12). figure 6-16 describes the timing of the data blocks with and without card busy signal. host cmnd n cr cycles ?? card response ? cmd ezz p * p s t content crc ezz p * * * * * * * * * * * * p p p p p p p p p p n wr ? write data ?? crc status ? busy ? dat0 z z * * * * * * z z z * * * * * z z p * p s content crc e z z s status e s l * l e z dat1-7 z z * * * * * * z z z * * * * * z z p * p s content crc e z z x * * * * * * * * * * * * x z card rsp cmd ezz p * * * * * * * * * * * * * * * * p p p p p * * * * * * * * * * * * * * * * p p p p p p p p p n wr ? write data crc status n wr ? write data crc status busy n wr dat0 zz p * p s data + crc e z z s status ez p * p s data + crc e z z s status e s l * l ez p * p dat1-7 zz p * p s data + crc e z z x * * * xz p * p s data + crc e z z x * * * * * * * * * * xz p * p figure 6-16 : multiple block write timing
multimediacard tm 76 sep.22.2005 revision 0.3 the stop transmission command works similar as in the read mo de. figure 6-17 to figure 6-20 describe the timing of the stop command in different card states. figure 6-17 : stop transmission during data transfer from the host the card will treat a data block as successfully received and ready for programming only if the crc data of the block was validated and the crc status tokens sent back to the host. fi gure 6-18 is an example of an interrupted (by a host stop command) attempt to transmit the crc status block. the seq uence is identical to all other stop transmission examples. the end bit of the host command is followed, on the data lines, with one more data bit, an end bit and two z clocks for switching the bus direction. the received data block, in th is case is considered incomplete and will not be programmed. figure 6-18 : stop transmission duri ng crc status transfer from the card all previous examples dealt with the scenar io of the host stopping the data transmission during an active data transfer. the following two diagrams describe a scena rio of receiving the stop transmission be tween data blocks. in the first exam- ple the card is busy programming the last block while in the se cond the card is idle. however, there are still unprogrammed data blocks in the input buffers. these blocks are being programmed as soon as the stop transmission command is received and the card activates the busy signal. ? host command ? n cr cycles ? ?? card response ?? ?? host cmnd cmd s t content crc ezz p p * * * p s t content crc ezz p p s t content n st ?? busy (card is programming) ?? dat0 d d d d d d d d d d ezz s l * * * * * * * * * * * * * * * * * * * ezzzzzzzz dat1-7 d d d d d d d d d d ezz x * * * * * * * * * * * * * * * * * * * * * * xzzzzzzzz ?? valid write data ?? ?? host command ? ??? n cr cycles ?? ?? card response ?? ? host cmnd cmd s t content crc ezz p p * * * * * * p s t content crc ezz p p s t content data block crc status a a.the card crc status respons e is interrupted by the host. ???? busy (card is programming) ???? dat0 data + crc ezz s crc ezz s l * * * * * * * * * * * * * * * * * * * * * * ezzzzzzzz dat1-7 data + crc ezz x * * * xzz x * * * * * * * * * * * * * * * * * * * * * * * * xzzzzzzzz
multimediacard tm 77 sep.22.2005 revision 0.3 figure 6-19 : stop transmission after last data block. card is busy programming. figure 6-20 : stop transmission after last data block. card becomes busy. ? erase, set and clear write protect timing the host must first select the erase groups to be erased using the erase start and end command (cmd35, cmd36). the erase command (cmd38), once issued, will erase all selected erase groups. similarly, set and clear write protect com- mands start a programming operation as well. the card will sig nal ?busy? (by pulling the dat0 line low) for the duration of the erase or programming operat ion. the bus transaction timings are identical to the variation of the stop transmission described in figure 6-20. ? reselecting a busy card when a busy card which is currently in the dis state is reselected it will reinstate its busy signaling on the data line dat0. the timing diagram for this command / response / busy transaction is given in figure 6-20. 6.15 bus test procedure timing after reaching the tran-state a host can in itiate the bus testing procedure. if ther e is no response to the cmd19 sent by the host, the host should read the status from the card wi th cmd13. if there was no response to cmd19, the host may assume that this function is not supported by the card. figure 6-21: 4 bit system bus testing procedure ?? host command ? ? n cr cycles ?? card response ?? ? host cmnd cmd s t content crc ezz p * * * p s t content crc ezz p p p p s t content ???????????? busy (card is programming) ???????????? dat0 l l * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * l ezzzzzzzz dat1-7 x x * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * x xzzzzzzzz ?? host command ? ? n cr cycles ?? card response ?? ? host cmnd cmd s t content crc ezz p * * * p s t content crc ezz p p p p s t content n st ????? busy (card is programming) ????? dat0 zzzzzzzzzz z s l * * * * * * * * * * * * * * * * * * * * * l ezzzzzzzz dat1-7 zzzzzzzzzz z x x * * * * * * * * * * * * * * * * * * * * * x xzzzzzzzz cmd cmd19 rsp19 cmd14 rsp14 cmd6 rsp6 n wr n rc n ac n rc dat0 z z * * * * * * * z z z s 10 x x x e z z * * * * * * * z z z s 01 000000 crc16 e z z * * * * * * * z z z dat1 z z * * * * * * * z z z s 01 x x x e z z * * * * * * * z z z s 10 000000 crc16 e z z * * * * * * * z z z dat2 z z * * * * * * * z z z s 10 x x x e z z * * * * * * * z z z s 01 000000 crc16 e z z * * * * * * * z z z dat3 z z * * * * * * * z z z s 01 x x x e z z * * * * * * * z z z s 10 000000 crc16 e z z * * * * * * * z z z dat4-7 z z * * * * * * * z z z z z * * * z z z z z * * * * * * * z z z s 00 000000 crc16 e z z * * * * * * * z z z stuff bits optional
multimediacard tm 78 sep.22.2005 revision 0.3 6.16 timing values symbol min max unit n cr 2 64 clock cycles n id 5 5 clock cycles n ac 2 10 * (taac *f op + 100 * nsac) a a. f op is the mmc clock frequency the host is using for the read operation. following is a calculation example: csd value for taac is 0x26; this is equal to 1.5msec; csd value for nsac is 0; the host frequency f op is 10mhz clock cycles n rc 8 - clock cycles n cc 8 - clock cycles n wr 2 - clock cycles n st 2 2 clock cycles n ac 10 1.5 3 ? 10 10 6 10 0 + () 150 000 clock cycles , ==
multimediacard tm 79 sep.22.2005 revision 0.3 introduction the spi mode consists of a secondary, optional communicat ion protocol which is offered by flash-based multimedi- acards. this mode is a subset of t he multimediacard protocol, designed to communicate with a spi channel, commonly found in motorola?s (and lately a few other vendors?) microcon trollers. the interface is selected during the first reset com- mand after power up (cmd0) and cannot be changed once the part is powered on. the spi standard defines the physical link only, and not t he complete data transfer prot ocol. the multimediacard spi implementation uses a subset of the multimediacard protocol and command set. it is intended to be used by systems which typically require one card and have lower data transfer rates (compared to multimediacard protocol based sys- tems). from the application point of vi ew, the advantage of the spi mode is the capability of using an off-the-shelf host, hence reducing the design-in effort to minimum. the disadv antage is the loss of performance of the spi mode versus mul- timediacard mode (lower data transfer rate, hardware cs, etc.). 7.1 spi interface concept the serial peripheral interface (spi) is a general purpose synchronous serial interface originally found on certain motorola microcontrollers. a virtually identical interface can now be found on certain ti and sgs thomson microcontrollers as well. the multimediacard spi interface is compatible with spi hosts available on the market. as in any other spi device, the multimediacard spi channel consis ts of the following four signals: cs : host to card ch ip select signal. clk :host to card clock signal datain :host to card data signal. dataout : card to host data signal. another spi common characteristic is byte transfers, which is implemented in the card as well. all data tokens are multi- ples of bytes (8 bit) and always byte aligned to the cs signal. 7.2 spi bus topology the card identification and addressing methods are replaced by a hardware chip select (cs) signal. there are no broad- cast commands. for every command, a card (slave) is select ed by asserting (active low) the cs signal (see figure ). the cs signal must be continuously active for the duration of the spi transaction (command, response and data). the only exception occurs during card programming, when the host can de-assert the cs signal without affecting the program- ming process. the bidirectional cmd and dat lines are replaced by unidirectional datain and dataout signals. the multimediacard pin assignment in spi mode (compared to multimediacard mode) is given in table 7-1. 7. spi mode
multimediacard tm 80 sep.22.2005 revision 0.3 figure 7-1 : multimediacard bus system 7.3 card registers in spi mode the register usage in spi mode is summarized in table 7-2. most of them are inaccessible. pin # multimediacard mode spi mode name type a a. s: power supply; i: input; o: out put; pp: push-pull; od: open-drain; nc : not connected (or logical high) description name type description 1 dat3 i/o/pp data cs i chip select (neg true) 2 cmd i/o/pp/od command/response di i/pp data in 3v ss1 s supply voltage ground vss s supply voltage ground 4v dd s supply voltage vdd s supply voltage 5 clk i clock sclk i clock 6v ss2 s supply voltage ground vss2 s supply voltage ground 7 dat0 i/o/pp data do o/pp data out 8 dat1 i/o/pp data not used 9 dat2 i/o/pp data not used 10 dat4 i/o/pp data not used 11 dat5 i/o/pp data not used 12 dat6 i/o/pp data not used 13 dat7 i/o/pp data not used table 7-1 : spi interface pin configuration spi bus (clk, datain, dataout ) spi bus master power supply cs spi card
multimediacard tm 81 sep.22.2005 revision 0.3 7.4 spi bus protocol while the multimediacard channel is based on command and data bit streams which are initiated by a start bit and termi- nated by a stop bit, the spi channel is by te oriented. every command or data blo ck is built of 8-bit bytes and is byte aligned to the cs si gnal (i.e. the length is a multiple of 8 clock cycles). similar to the multimediacard protocol, the spi messages co nsist of command, response and data-block tokens. all com- munication between host and card is controlled by the host (mast er). the host starts every bus transaction by asserting the cs signal low. the response behavior in the spi mode differs from t he multimediacard mode in the following three aspects: ? the selected card always responds to the command. ? additional (8, 16 & 40 bit) response structures are used ? when the card encounters a data retrieval problem, it will respond with an error response (which replaces the expected data block) rather t han by a time-out, as in the multimediacard mode. only single and multiple block read/write operations are su pported in spi mode (sequential m ode is not supported). in addition to the command response, every data block sent to t he card during write operations will be responded to with a spe- cial data response token. a data block may be as big as one card write block and as small as a single byte. partial block read/write operations are enabled by card options specified in the csd register. 7.5 mode selection the multimediacard wakes up in the mult imediacard mode. it will enter spi mode if the cs signal is asserted (negative) during the reception of the reset command (cmd 0). selecting spi mode is not restricted to idle state (the state the card enters after power up) only. every time the card receives cmd0, including while in inactive state, cs signal is sampled. if the card recognizes that the multim ediacard mode is required (cs signal is high), it will not respond to the command and remain in the multimediacard mode. if spi mode is re quired (cs signal is low), the card will switch to spi and respond with the spi mode r1 response. the only way to return to the multimediacard mode is by a po wer cycle (turn the power off an on). in spi mode, the multi- mediacard protocol state machine is not observed. all the multimediacard comm ands supported in spi mode are always available. name available in spi mode width [bytes] description cid yes 16 card identification data (serial number, manufacturer id, etc.) rca no dsr no csd yes 16 card-specific data, information about the card operation conditions. ext_csd yes 512 extended card-specific data, information about the card supported properties and configured modes ocr yes 32 operation condition register. table 7-2 : multimediacard registers in spi mode
multimediacard tm 82 sep.22.2005 revision 0.3 7.6 bus transfer protection every multimediacard token transferred on the bus is protected by crc bits. in spi mode, the multimediacard offers a non-protected mode which enables systems built with reliable data links to exclude the hardware or firmware required for implementing the crc generation and verification functions. in the non-protect ed mode, the crc bits of the command, response and data tokens are still required in the tokens. howe ver, they are defined as ?don?t care? for the transmitter and ignored by the receiver. the spi interface is initialized in th e non-protected mode. however, the reset command (cmd0), which is used to switch the card to spi mode, is received by the card while in multimediacard mode and, therefore, must have a valid crc field. since cmd0 has no arguments, the content of all the fields, including the crc field, are constants and need not be calcu- lated in run time. a valid reset command is: 0x40, 0x0, 0x0, 0x0, 0x0, 0x95 the host can turn the crc option on and off using the crc_on_off command (cmd59). 7.7 data read the spi mode supports single and multiple block read oper ations. the main difference between spi and multimediacard modes is that the data and the response are both transmitted to the host on the dataout signal (refer to figure 7-2 and figure 7-3). therefore the card response to the stop_c ommand may cut-short and replace the last data block. figure 7-2 : spi single block read operation figure 7-3 : spi multiple block read operation command datain dataout from host to card data from card to host from card to host data block response command next command crc command datain dataout from host to card data from card to host from card to host data block response command stop command crc data block crc response data b.
multimediacard tm 83 sep.22.2005 revision 0.3 the basic unit of data transfer is a block whose maximum size is defined in the csd (read_bl_len).if read_bl_partial is set, smaller blocks whose starting and ending address are entirely contained within one physical block (as defined by read_bl_len) may also be transmitted. a crc is appended to the end of each block ensuring data transfer integrity. cmd17 (read_single_block) initiate s a single block read. cmd18 (read_multiple_block) starts a transfer of several consecutive blocks. two types of mu ltiple block read tr ansactions are defined (the host can use either one at any time): ? open-ended multiple block read the number of blocks for the read multip le block operation is not de fined. the card will continuo usly transfer data blocks until a stop transmission command is received. ? multiple block read with pre-defined block count the card will transfer the requested number of data blocks and terminate the transaction. stop command is not required at the end of this type of multiple block read, unless terminated with an error. in order to start a multiple block read with pre- defined block count the host must use the set_block _count command (cmd23) immediately preceding the read_multiple_block (cmd18) command. otherwise the ca rd will start an open-ended multiple block read which can be stopped using the st op_transmision command. if the host provides an out of range add ress as an argument to either cmd17 or cmd18, or the currently defined block length is illegal for a read op eration, the card will reject the command and re spond with the ad dress_out_of_range or block_len_error bit set, respectively. if the host sets the argument of the set_block_count command (cmd23) to a ll 0s, then the command is accepted; however, a subsequent read will follow the open-ended multip le block read protocol (stop_transmission command - cmd12 - is required). the host can abort reading at any time, within a multiple block o peration, regardless of the its type. transaction abort is done by sending the stop transmission command. if the host provides an out of range add ress as an argument to either cmd17 or cmd18, or the currently defined block length is illegal for a read op eration, the card will reject the command and re spond with the ad dress_out_of_range or block_len_error bit set, respectively. if the host sets the argument of the set_block _count command (cmd23) to all 0s, then the command is accepted: however , a subsequent read will follow the open-ended multip le block read protocol (stop_transmission command - cmd12 - is required). in case of a data retrieval error (e.g. out of range, address misalignment, internal error, etc.) detected during data transfer , the card will not transmit any data. instead (as opposed to mult imediacard mode where the card times out), a special data error token will be sent to the host. figure 7-4 shows a si ngle block read operation which terminates with an error token rather than a data block. figure 7-4 : spi read operation - data error multiple block read operation can be te rminated the same way, the error token replacing a data block anywhere in the sequence. the host must than abort the opera tion by sending the stop transmission command. if the host sends a stop transmission comma nd after the card transmitted the last bloc k of a multiple block read with a pre- defined number of blocks, it will be responded to as an illegal command. command datain dataout from host to card data error token from card to host from card to host data error response command next command
multimediacard tm 84 sep.22.2005 revision 0.3 if the host uses partial blocks whose accumu lated length is not block aligned, and block misalignment is not allowed, the card shall detect a block misalignment error condition during the transmission of the first misaligned block and the content of the further transferred bits is undefined. as t he host sends cmd12, the card will respond with the address_misalign bit set. 7.8 data write the spi mode supports single block and multiple block write commands. upon reception of a valid write command (cmd24 or cmd25), the card will respond with a response token and will wait for a data block to be sent from the host. crc suffix, block length and start address restrictions are (with the exception of the csd parameter write_bl_partial controlling the partial block write option) identical to the re ad operation (see figure 7-5). if a crc error is detected it wil l be reported in the data-response token and the data block will not be programmed. figure 7-5 : spi single block write operation every data block has a prefix of ?start block? token (one byte). after a data block has been received, the card will respond with a data-response token. if the data block has been received without errors, it will be programmed. as long as the card is busy programming, a continuous stream of busy tokens will be sent to the host (eff ectively holding the dataout line low). in multiple block write operation the st op transmission will be done by sending ?stop tran? token instead of ?start block? token at the beginning of the next block. figure 7-6 : spi multiple block write operation two types of multiple block write transacti ons, identical to the multiple block read, are defined (the host can use either one at any time): ? open-ended multiple block write the number of blocks for the write multiple block operation is not defined. the card will continuously accept and program data blocks until a ?stop tran? token is received. data_response command datain dataout from host to card new command from host data from host to card from card to host data block busy data response and busy from card to host response start block token command data command datain dataout from host to card data from host to card from card to host data busy data response and busy from card response start block token stop tran token to card busy response block data from host to card data block data busy response
multimediacard tm 85 sep.22.2005 revision 0.3 ? multiple block write with pre-defined block count the card will accept the requested number of da ta blocks and terminate the transaction. ?sto p tran? token is not required at the end of this type of multiple block wr ite, unless terminated with an error. in or der to start a multiple block write with pr e- defined block count the host must use the set_block _count command (cmd23) immediately preceding the write_multiple_block (cmd25) command. otherwise the ca rd will start an open-ended multiple block write which can be stopped using the ?stop tran? token. the host can abort writing at any time, within a multiple block operation, rega rdless of the its type. transaction abort is done by sending the ?stop tran? token. if a multiple block write with pre-defined blo ck count is aborted, the data in the remaining blocks is not defined. if the host provides an out of range add ress as an argument to either cmd17 or cmd18, or the currently defined block length is illegal for a read operation, the card will reject the command, remain in tran state and respond with the address_out_of_range or block_len_error bit set, respectively. if the host sets the argument of the set_block_count command (cmd23) to a ll 0s, then the command is accepted; however, a subsequent write will follow t he open-ended multiple block write pr otocol (stop_transmission command - cmd12 - is required). if the card detects a crc error or a programming error (e.g. write protect violation, out of range, address misalignment, internal error, etc.) during a multiple block write operation (both types) it will report the failure in the data-response toke n and ignore any further incoming data blocks. the host mu st than abort the opera tion by sending the ?stop tran? token. if the host uses partial blocks whose accumulated length is not block aligned, and block misalignment is not allowed (csd parameter write_blk_misalign is not set), the card shall de tect the block misalignment error during the reception of the first misaligned block, abort the write operation, and ignore all further incoming data. the host must abort the operation by sending the ?stop tran? token, to which the card will respond with the address_misalign bit set. once the programming operation is completed (either successfully or with an error), the host must check the results of the programming (or the cause of the error if already report ed in the data-response token) using the send_status com- mand (cmd13). if the host sends a ?stop trans? token after the card received th e last data block of a multiple block operation with pre- defined number of blocks, it will be interpreted as the beginning of an illegal command and responded accordingly. while the card is busy, resetting the cs signal will not te rminate the programming process. the card will release the dataout line (tri-state) and continue with programming. if the card is reselected before the programming is finished, the dataout line will be forced back to low and all commands will be rejected. resetting a card (using cmd0) will terminate any pending or active programming operations. this may destroy the data formats on the card. it is in the res ponsibility of the host to prevent it. 7.9 erase & write protect management the erase and write protect ma nagement procedures in the spi mode are identi cal to those of the multimediacard mode. while the card is erasing or changing the write protection bits of the predefined erase groups list, it will be in a busy state and hold the dataout line low. figure 7-7 illustrates a ?no data? bus transaction with and without busy signalling. figure 7-7 : spi ?no data? operations command command datain dataout from host to card from host to card from card to host response response from card to host busy
multimediacard tm 86 sep.22.2005 revision 0.3 7.10 read cid/csd registers unlike the multimediacard protocol (where the register conten ts is sent as a command res ponse), reading the contents of the csd and cid registers in spi mode is a simple read-block transaction. the card will respond with a standard response token (see figure ) followed by a data block of 16 bytes suffixed with a 16 bit crc. the data time out for the csd command cannot be set to the card taac since this value is stored in the csd. refer to section 7.23.2 for detailed timing. for consist ency, read cid transaction is identical to read csd. 7.11 reset sequence the multimediacard requires a defined reset sequence. after power on reset or cmd0 (software reset) the card enters an idle state. at this state the only legal host comm ands are cmd1 (send_op_co nd) and cmd58 (read_ocr). the host must poll the card (by repeatedly sending cmd1) until the ?in-idle-state? bit in the card response indicates (by being set to 0) that the card has completed its initia lization processes and is ready for the next command. in spi mode, as opposed to multimediacard mode, cmd1 ha s no operands and does not return the contents of the ocr register. instead, the host may use cmd58 (available in spi mode only) to read the ocr register. furthermore, it is in the responsibility of the host to refrain from accessing a card that does not support its voltage range. the usage of cmd58 is not restricted to the initializing phase only, but can be issued at any time. the host must poll the card (by repeatedly sending cmd1) until the ?in-idle-state? bit in the card response indicates (by being set to 0) that the card has completed its initialization processes and is ready for the next command. 7.12 clock control the spi bus clock signal can be used by the spi host to put the card into energy saving mode or to control the data flow (to avoid under-run or over-run conditions) on the bus. the host is allowed to change the clock frequency or shut it down. there are a few restrictions the spi host must follow: ? the bus frequency can be changed at any time (under the re strictions of maximum data transfer frequency, defined by the multimediacards) ? it is an obvious requirement that the clock must be running for the multimediacard to output data or response tokens. after the last spi bus transaction, the host is required, to provide 8 (eight) clock c ycles for the card to complete the opera- tion before shutting down the clock. throughout this 8 clocks period the state of the cs signal is irrelevant. it can be asserted or de-asserted. following is a list of the various spi bus transactions: ? a command / response sequence. 8 clocks after the card response end bit. the cs signal can be asserted or de- asserted during these 8 clocks. ? a read data transaction. 8 clocks after the end bit of the last data block. ? a write data transaction. 8 clocks after the crc status token. ? the host is allowed to shut down t he clock of a ?busy? card. the multimediacard will complete the programming opera- tion regardless of the host clock. however, the host must provide a clock edge for the card to turn off its busy signal. with- out a clock edge the multimediacard (unless previously discon nected by de-asserting the cs signal) will force the dataout line down, permanently.
multimediacard tm 87 sep.22.2005 revision 0.3 7.13 error conditions 7.13.1 crc and illegal command all commands are (optionally) pr otected by crc (cyclic redundancy check) bits. if the addressed multim ediacard's crc check fails, the com_crc_error bit will be set in the card's response. similarly, if an illegal command has been received the illegal_command bit will be set in the card's response. there are different kinds of illegal commands: ? commands which belong to classes not supported by the multimediacard (e.g. interrupt and i/o commands). ? commands not allowed in spi mode (e.g. cmd20 - write stream) ? commands which are not defined (e.g. cmd47). 7.13.2 read, write, erase and force erase time-out conditions the time period after which a time-out condition for read/ write/erase operations occurs are (card independent) 10 times longer than the typical access/program times for these operatio ns given below. a card shall complete the command within this time period, or give up and return an error message. if th e host does not get a response wit hin the defined time-out it should assume the card is not going to respond any more and try to recover (e.g. reset the card, power cycle, reject, etc.). the typical access and program times are defined as follows: 7.13.3 read the read access time is defined as the sum of the two times given by the csd parameters taac and nsac. these card parameters define the typical delay between the end bit of t he read command and the start bit of the data block. this num- ber is card dependent. 7.13.4 write the r2w_factor field in the csd is used to calculate the ty pical block program time obtained by multiplying the read access time by this factor. it applies to all wr ite/erase commands (e.g. set(clear)_write_protect, program_csd(cid) and the block write commands). 7.13.5 erase the duration of an erase comma nd will be (order of magnitude) the number of write blocks to be erased multiplied by the block write delay. 7.13.6 force erase the force erase time-out is specified in chapter 6.5.2
multimediacard tm 88 sep.22.2005 revision 0.3 7.14 read ahead in multiple block read operation in multiple block read operations, in order to improve read pe rformance, the card may fetch data from the memory array, ahead of the host. in this case, when the host is reading the la st addresses of the memory, the card attempts to fetch data beyond the last physical memory address a nd generates an address_out_of_range error. therefore, even if the host times the stop transmission command to stop the card i mmediately after the last byte of data was read, the card may already have generated the error, and it will show in the response to the stop transmission com- mand. the host should ignore this error. 7.15 memory array partitioning same as for multimediacard mode. 7.16 card lock/unlock operation usage of card lock and unlock commands in spi mode is iden tical to multimediacard mode. in both cases, the command response is of type r1b. after the busy signal clears, the ho st should obtain the result of the operation by issuing a get_status command. please refer to chapter 6.2.10 for details. 7.17 spi command set 7.17.1 command format all the multimediacard commands are 6 bytes long. the command transmission alwa ys starts with the left bit of the bit- string corresponding to the command codeword. all commands are protected by a crc. the commands and arguments are listed in table 7-5. 7.17.2 command classes as in multimediacard mode, the spi comm ands are divided into several classes (see table 7-4). each class supports a set of card functions. a multimediacard will support the sa me set of optional command classes in both communication modes (there is only one command class table in the csd regi ster). the available comand classes, and the supported command for a specific class, however, are different in the multimediacard and the spi communication mode. bit position 47 46 [45:40] [39:8] [7:1] 0 width (bits) 1 1 6 32 7 1 value ?0? ?1? x x x ?1? description start bit transmission bit command index argument crc7 end bit table 7-3 : command format in spi mode
multimediacard tm 89 sep.22.2005 revision 0.3 7.17.3 command description the following table provides a detailed description of the spi mode commands. the respons es are defined in chapter 7.18. table 7-5 lists all multimediacard commands. a ?yes? in the spi mode column indicates that the command is sup- ported in spi mode. with these restrictions, the command cla ss description in the csd is still valid. if a command does not require an argument, the value of this field should be set to zero. the reserved commands are also reserved in multimedi- acard mode. the card can be switched to a new command space, using t he switch command, just as in multimediacard mode; with the only limitation that in spi mo de the bus is always one bit wide. the binary code of a command is defined by the m nemonic symbol. as an exam ple, the content of the command index field is (binary) ?000000? for cmd0 and ?100111? for cmd39. card cmd class (ccc) class description supported commands 0 1 6 8 9 1 0 1 2 1 3 1 6 1 7 1 8 2 3 2 4 2 5 2 7 2 8 2 9 3 0 3 5 3 6 3 8 4 2 5 5 5 6 5 8 5 9 class 0 basic ++++++ + ++ class 1 not supported in spi class 2 block read + ++++ class 3 not supported in spi class 4 block write + ++++ class 5 erase +++ class 6 write-protection + + + class 7 lock card + + class 8 application specific ++ class 9 not supported in spi class 10-11 reserved cmd index spi mode argument resp abbreviation command description cmd0 yes none r1 go_idle_state resets the multimediacard cmd1 yes none r1 send_op_cond activates the card?s initialization process cmd2 no cmd3 no cmd4 no cmd5 reserved
multimediacard tm 90 sep.22.2005 revision 0.3 cmd index spi mode argument resp abbreviation command description cmd6 yes [31:26] set to 0 [25:24] access [23:16] index [15:8] value [7:3] set to 0 [2:0] cmd set r1b switch switches the mo de of operation of the selected card and modifies the ext_csd registers. access modes are: 00command set 01set bits 10clear bits 11write byte cmd7 no cmd8 yes [31:0] stuff bits r1 send_ext_csd the card sends its ext_csd register as a block of data. cmd9 yes none r1 send_csd asks the sele cted card to send its card- specific data (csd) cmd10 yes none r1 send_cid asks the selected card to send its card identification (cid) cmd11 no cmd12 yes none r1 stop_transmission stop transmission on multiple block read cmd13 yes none r2 send_status asks the selected card to send its status register cmd14 this command is not applicable in spi mode a nd the card should regard it as illegal command cmd15 no cmd16 yes [31:0] block length r1 set_blocklen selec ts a block length (in bytes) for all fol- lowing block commands (read and write) 1 cmd17 yes [31:0] data address r1 read_ single_block reads a block of the size selected by the set_blocklen command 2 cmd18 yes [31:0] data address r1 read_ multiple_block continuously transfers data blocks from card to host until interrupted by a stop command or the requested number of data blocks transmitted cmd19 this command is not applicable in spi mode a nd the card should regard it as illegal command cmd20 no cmd21 ... cmd22 reserved cmd23 yes [31:16] set to 0 [15:0] number of blocks r1 set_ block_count defines the number of blocks which are going to be transferred in the immediately exceeding multiple block read or write command. if the argument is all 0s, then the subse- quent read/write operation will be open- ended.
multimediacard tm 91 sep.22.2005 revision 0.3 cmd index spi mode argument resp abbreviation command description cmd24 yes [31:0] data address r1 write_block writes a block of the size selected by the set_blocklen command. 3 cmd25 yes [31:0] data address r1 write_ multiple_block continuously writes blocks of data until a ?stop tran? token or the requested num- ber of blocks received. cmd26 no cmd27 yes none r1 program_csd programming of the programmable bits of the csd cmd28 yes [31:0] data address r1b 4 set_write_prot if the card ha s write protection features, this command sets t he write protection bit of the addressed group. the properties of write protection are co ded in the card spe- cific data (wp_grp_size). cmd29 yes [31:0] data address r1b clr_write_prot if the card has write protection features, this command clears the write protection bit of the addressed group cmd30 yes [31:0] write protect data address r1 send_write_prot if the card has write protection features, this command asks the card to send the status of the write protection bits 5 cmd31 reserved cmd32 ... cmd34 reserved. these command indexes cannot be used in order to main tain backwards compatibility with older versions of the multimediacards cmd35 yes [31:0] data address r1 erase_group_ start sets the address of the first erase group within a range to be selected for erase cmd36 yes [31:0] data address r1 erase_group_ end sets the address of the last erase group within a continuous range to be selected for erase cmd37 reserved. this command index cannot be used in order to maintain backwards compatibility with older versions of the multimediacards cmd38 yes [31:0] stuff bits r1b erase eras es all previously selected erase groups cmd39 no cmd40 no cmd41 reserved cmd42 yes [31:0] stuff bits. r1b lock_unloc k used to set/reset the password or lock/ unlock the card. the structure of the data block is described in chapter 4.4.10. the size of the data block is defined by the set_block_len command.
multimediacard tm 92 sep.22.2005 revision 0.3 1) the default block length is as specified in the csd. 2) the data transferred must not cross a physical bloc k boundary unless read_blk_misalign is set in the csd. 3) the data transferred must not cross a physical bloc k boundary unless write_blk_misalign is set in the csd. 4) r1b : r1 is response with an optional trailing busy signal. 5) 32 write protection bits (representing 32 write protect groups starti ng at the specified address) followed by 16 crc bits are transferred in a payload format via the data line. the last (l east significant) bit of the protection bits corresponds to t he first addressed group. if the address of the last groups are outsi de the valid range, then the corresponding write protection bits are set to zero. 6) rd/wr_: "1" the host receives a data block from the card. "0" the host sends a data block to the card. 7.18 responses there are several types of response tokens. as in the multimediacard mode, all are transmitted msb first: 7.18.1 format r1 this response token is sent by the card after every comman d, with the exception of send_status commands. it is one byte long, and the msb is always set to zero. the other bits are error indications, an error being signaled by a ?1?. the structure of the r1 format is given in figure 7-8. the meaning of the flags is defined as follows: ? in idle state : the card is in idle state and running the initializing process. ? erase reset: an erase sequence was cleared before executing bec ause ?non erase? command (neither of cmd35, cmd36, cmd38 or cmd13) was received. ? illegal command : an illegal command code was detected or the card did not switch to the requested mode. ? communication crc error : the crc check of the last command failed. ? erase sequence error : an error occurred in the sequence of erase commands (cmd35, cmd36, cmd38). ? address misaligned : a misaligned block is detected during data transfer. ? address out of range | block length error : the command?s argument was out of the allowed range for this card. cmd index spi mode argument resp abbreviation command description cmd43 ... cmd54 reserved cmd55 yes [31:0] stuff bits r1 app_cmd defines to the card that the next command is an application specific command rather than a standard command cmd56 yes [31:1] stuff bits [0] rd/wr_ 6 r1b gen_cmd used either to transfer a data block to the card or to get a data block from the card for general purpose / application sepcific commands. the size of the data block is defined by the set_block_len com- mand. cmd57 reserved cmd58 yes none r3 read_ocr reads the ocr register of a card cmd59 yes [31:1] stuff bits [0:0] crc option r1 crc_on_off turns the crc option on or off. a ?1? in the crc option bit will turn the option on, a ?0? will turn it off cmd60 ... cmd63 no
multimediacard tm 93 sep.22.2005 revision 0.3 figure 7-8 : r1 response format 7.18.2 format r1b this response token is identical to the r1 format with the addition of an immediately following busy signal. figure 7-9 : r1b response format 7.18.3 busy the busy signal token can be any number of bytes. a zero value indicates card is busy. a non-zero value indicates the card is ready for the next command. 7.18.4 format r2 this response token is two bytes long and sent as a re sponse to the send_status command. the format is given in figure 7-10. the first byte is identical to the response r1. the co ntent of the second byte is described in the following: ? csd overwrite: this status bit is set if the host is trying to change the rom section, or reverse the copy bit (set as orig- inal) or the permanent wp bit (un- protect) of the csd register. ? erase param : an invalid selection of erase groups, for erase. ? write protect violation : the command tried to write a write-protected block. ? card ecc failed : card internal ecc was applied but failed to correct the data. ? card error : generic (undifined by the standard) internal card error unrelated to the host activities. ? execution error : generic (undefined by the standard) internal card e rror, occured while (and related to) execution of the last hot command ? write protect erase skip | lock/unlock command failed : this status bit has two functions. it is set when the host attempts to erase a write-protect ed block or if a sequence or password error occurred during a card lock/unlock operation. ? card is locked : set when the card is locked by the user. reset when it is unlocked. 0 7 in idle state erase reset illegal command | switch error com crc error erase sequence error address misalign address out of range | block length error 0 0 r1 busy tokens
multimediacard tm 94 sep.22.2005 revision 0.3 figure 7-10 : r2 response format 7.18.5 format r3 this response token is sent by the card when a read_ocr command is received. the response length is 5 bytes (see figure 7-11). the structure of the first (m sb) byte is identical to response type r1. the other four bytes contain the ocr register. figure 7-11 : r3 response format 7.18.6 data response every data block written to the card will be acknowledged by a dat a response token. it is one byte long and has the follow- ing format: figure 7-12 : data response format 76 0 xxx0status 1 card is locked wp erase skip | lock/unlock cmd failed execution error card error card ecc failed wp violation erase param 7 0 csd overwrite 2 nd byte in idle state erase reset illegal command | switch error com crc error erase sequence error address misalign address out of range | block length error 7 0 1 st byte 0 32 39 0 31 0 r1 ocr
multimediacard tm 95 sep.22.2005 revision 0.3 the meaning of the status bits is defined as follows: ?010? - data accepted. ?101? - data rejected due to a crc error. ?110? - data rejected due to a write error in case of any error (crc or write erro r) during write multiple block operation, t he host shall abort the operation using the ?stop tran? token. in case of write error (response ?110? ) the host should send cmd13 (send_status) in order to get the cause of th e write problem. 7.19 data tokens read and write commands have data transfers associated with them. data is being transmitted or received via data tokens. all data bytes are transmitted msb first. data tokens are 4 to (n + 3) bytes long (where n is t he data block length set using the set_block_length command) and have the following format: ? first byte: figure 7-13 : start data block token format ? bytes 2 - (n + 1): user data ? last two bytes: 16 bit crc. 7.20 data token error if a read operation fails and the card cannot provide the require d data, it will send a data error token instead. this token is one byte long and has the following format: token type transaction type 7 bit position 0 start block single block read 11111110 start block multiple block read 11111110 start block single block write 11111110 start block multiple block write 11111100 stop tran multiple block write 11111101
multimediacard tm 96 sep.22.2005 revision 0.3 figure 7-14 : data error token the 5 least significant bits (lsb) are the same error bits as in the response format r2. 7.21 clearing status bits as described in the previous paragraphs, in spi mode, error a nd status bits are reported to the host in three different for- mats: response r1, response r2 and data error token (the same bits may exist in multiple response types?e.g address out of range. all error bits defined in multimediacard mode, with the exception of underrun and overrun, have the same meaning and usage in spi mode. there are some differences in the status bits due to the di fferent protocol (e.g. current state is not defined in spi mode). the detection mode and clear condition of error and status bits are identical to the mul- timediacard mode, with one exception, error bits are clear ed when read by the host, regardless of the response format. the following table describes the the various status bits:. idnetifier included in rep type det mode value description clear cond address out of range r1 r2 dataerr e r ?0?= no error ?1?= error the command?s address argument was out of the allowed range for this card. c x a multiple block or stream read/ write opera- tion is attempting to read or write beyond the card capacity (although it started in a valid address) address misalign r1 r2 dataerr e r ?0?= no error ?1?= error the command? s address argument (in accordance with the currently set block length) positions the first data block mis- aligned to the card physical blocks. c x a multiple block read/write operation is attempting to read or write a data block, which is not aligned to the physical blocks of the card (although it started with a valid address/block-leng th combination) erase sequence error r1 r2 e r ?0?= no error ?1?= error an error in the sequence of erase com- mands occurred. c erase param r2 e x ?0?= no error ?1?= error an invalid selection of erase groups, for erase, occurred. c 0 7 execution error card error card ecc failed address out of range address misalign 0 0 0
multimediacard tm 97 sep.22.2005 revision 0.3 idnetifier included in rep type det mode value description clear cond block length error r1 r2 e r ?0?= no error ?1?= error either the argument of a set_blocklen command exceeds the maximum allowed value for the card, or the previously defined block length is illegal for the current com- mand (e.g. the host is issues a write com- mand and the current block length is smaller than the card maximum value and write partial blocks is not allowed) c wp violation r2 e x ?0?= not pro- tected ?1?= protected attempt to program a write protected block. c com crc error r1 r2 e r ?0?= no error ?1?= error the crc check of the received command failed. c illegal command r1 r2 e r ?0?= no error ?1?= error the received command is not legal for the card state. c switch error r1 r2 e x ?0?= no error ?1?= error if set, the card did not switch to the expected mode as requested by the switch command c card ecc failed r2 dataerr e x ?0?= success ?1?= failure card internal ecc was applied but failed to correct the data. c card error r2 dataerr e r ?0?= no error ?1?= error (undefined by the standard) a card error occurred, which is not related to the host command. c execution error r2 dataerr e x ?0?= no error ?1?= error (undefined by the standard) a generic card error related to the (and detected during) execut ion of the last host command (e.g. read or write failures). c wp erase skip r2 s x ?0?= not pro- tected ?1?= protected only partial address space was erased due to existing write protected blocks. c lock/unlock cmd failed r2 e x ?0?= no error ?1?= error sequence or password error during card lock/unlock operation. c card is locked r2 s ?0? = card is not locked ?1? = card is locked card is locked by a user password a erase reset r1 r2 e r ?0?= cleared ?1?= set an erase sequence was cleared before executing because an out of erase sequence command was received.(other than cmd35, cmd36, cmd38 or cmd13) c in idle state r1 r2 s 0 = card is ready 1 = card is in idle state the card enters the idle state after power up or reset command. it will exit this state and become ready upon completion of its initialization procedures. a csd overwrite r2 e x ?0?= no error ?1?= error the host is trying to change the rom sec- tion, or is trying to reverse the copy bit (set as original) or permanent wp bit (un-pro- tect) of the csd register. c
multimediacard tm 98 sep.22.2005 revision 0.3 7.22 card registers in spi mode, only the ocr, csd and cid registers are accessible. their format is identical to the format in the multimedi- acard mode. however, a few fields are irrelevant in spi mode. 7.23 spi bus timing diagrams all timing diagrams use the follo wing schematics and abbreviations: all timing values are defined in table7-9. the host must keep the clock running for at least n cr clock cycles after receiving the card response. this restriction applies to both command and data response tokens. 7.23.1 command / response ? host command to card response - card is ready the following timing diagram describes the basic command response (no data) spi transaction. figure 7-15 : spi command/response transaction, card is ready ? host command to card re sponse - card is busy the following timing diagram describes the command response transaction for commands when the card response is of type r1b (e.g. set_write_prot and erase). when the card is signaling busy, the host may deselect it (by raising the cs) at any time. the card will release the dataout line one clock after the cs going high. to check if the card is still busy, it needs to be reselected by asserting (set to low) the cs signal. the card will resume busy signal (pulling dataout low) one clock after the falling edge of cs. symbol definition h signal is high (logical ?1? l signal is low (logical ?0?) x don?t care (undefined value) z high impedance state (-> = 1) * repeater busy busy token command command token response response token data block data token cs h h l l l * * * * * * * * * * * * * * * * * * * * l l l l h h h ? n cs ? n ec datain x x h * * h 6 bytes command h h h h h * * * * * * * * * h * * h x x x ? n cr dataout zzz h h h h * * * * * * * * * h h * * * h 1 or 2 bytes response h h h h hzz
multimediacard tm 99 sep.22.2005 revision 0.3 ? card response to host command figure 7-17 : spi card response to the next host command 7.23.2 data read ? single block read figure 7-18 : spi single block read cs l l l l l * * * * * * * * * * * * * * * * * * * * l l h h h datain h h h h h h * * * * * * * * * h h h h 6 bytes command h h h h x x x n rc ? dataout h h h h h 1 or 2 bytes response h * * h * * * * * * * * * * h h h h hzz cs h l l l * * * * * * * * * * * * * * * * * * * * l l l h h h h n cs ? n ec datain x h * * h read command h h h h h * * * * * * * * * * * * * * * h * * h x x x x n cr ? n ac ? dataout zz h h h h * * * * * * * * h * * h card response h * * h data block h h h hzzz cs h l l l * * * * * * * * * * * * * * * * * * * * l l l l h h h l l l l l l h h n cs ? ? n ec n ds n ec datain x h * * h 6 bytes command h h h h h h h h h h * * h x * * x h h h h * * h x x ? n cr dataout zz h h h h * * * * * * * * * h * * * h card resp busy lzzz busy h h h hz figure 7-16 : spi command/response transaction, card is busy
multimediacard tm 100 sep.22.2005 revision 0.3 ? multiple block read - stop transmission is sent between blocks figure 7-19 : spi multiple block read , stop transmission does not overlap data the timing for de-asserting the cs signal after the last card response is identical to a standard command/response trans- action as described in figure 7-15; ? multiple block read - stop transmission is sent within a block figure 7-20 : spi multiple block re ad, stop transmission overlaps data in an open-ended (or host aborted) multiple block read tran saction the stop transmission command may be sent asyn- chronously to the data transmitted out of the card and may ov erlap the data block. in this case the card will stop sending the data and transmit the response token as well. the delay between command and response is standard n cr clocks. the first byte, however, is not guaranteed to be all set to ?1?. the card is allowed up to two clocks to stop data transmis- sion. the timing for de-asserting the cs signal after the last card response is identical to a standard command/ response trans- action as described in figure 7-15; ? reading the csd and cid registers the following timing diagram describes the send_csd and send_cid command bus transaction. the time-out values between the response and the data block is n cx , and not n ac , which is used for data read (since n ac is still unknown at the time the csd register is read). the send_cid transaction complies with the same timing diagram for consistency of the read register commands figure 7-21 : spi read csd and cid registers cs h l l * * * * * * * * * * * * * * * * * * * * l l l l l n cs datain x h * * h read cmd h h h h * * * * * * * * * * * * * * * h h stop cmd h h h h h h h n cr n ac n ac n cr dataout zz h h h * * * * h * * h card resp h * * h data block h * * h data block h h * * h card resp cs h l l * * * * * * * * * * * * * * * * * * * * l l l l l n cs datain x h * * h read cmd h h h h * * * * * * * * * * * * h h h stop cmd h h h h h h h h h h n cr n ac n ac ?? n cr ?? dataout zz h h h * * * * h * * h card resp h * * h data block h * * h data x x h * * h card resp cs h l l l * * * * * * * * * * * * * * * * * * * * l l l h h h h n cs ? n ec datain x h * * h send_csd/cid h h h h h * * * * * * * * * * * * * * * h * * h x x x x n cr ? n cx ? dataout zz h h h h * * * * * * * * h * * h card response h * * h data block h h h hzzz
multimediacard tm 101 sep.22.2005 revision 0.3 7.23.3 data write ? single block write the host may deselect a card (by raising the cs) at any time during the card busy period (refer to the given timing dia- gram). the card will release the dataout line one clock after the cs going high. to check if the card is still busy it needs to be reselected by asserting (set to low) the cs signal. t he card will resume busy signal (pulling dataout low) one clock cycle after the fall ing edge of cs. figure 7-22 : spi single block write ? multiple block write the timing behavior of the multiple block write transaction star ting from the command up to the first data block is identical to the single block write. figu re 7-23 describes the timing be tween the data blocks of a mult iple block write transaction. timing of the ?stop tran? token is identical to a standard data block. after the ?stop tran? token is received ny the card, the data on the dataout line is undefined for one byte (n br ), after which a busy token may appear. the host may deselect and reselect the card during every busy period between the data blocks. timing for toggling the cs signal is identical to the single block write transaction. figure 7-23 : spi multiple block write cs h l * * * * * * * * * * * * * * * * * * * * l l l l l l l l h h h l l l l n cs n wr n ec n ds datain x h * * h write cmd h h h h h h h h * * h data block h h h h * * h x * * x h h h h n cr dataout zz h h h * * * * h * * h card rsp h h h h h h h data resp busy lzzz busy h cs l * * * * * * * * * * * * * * * * * * * * l l l l l l l l l l l l l l l l l l l l n wr n wr datain h data block h h h h h h h h * * h data block h h h h h h h h * * h stop tran h h h h h n br dataout h h h h h data resp busy h h h h h h h data resp busy h h h h h h x * * x busy
multimediacard tm 102 sep.22.2005 revision 0.3 7.24 timing values 7.25 spi electrical interface identical to multimediacard mode, with the exception of the programmable card output drivers option, which is not sup- ported in spi mode. 7.26 spi bus operation conditions identical to multimediacard mode. 7.27 spi bus timing identical to multimediacard mode. the timing of t he cs signal is the same as any other card input. symbol min max unit n cs 0 - 8 clock cycles n cr 1 8 8 clock cycles n cx 0 8 8 clock cycles n rc 1 - 8 clock cycles n ac 1 (10/8) * (taac * f op + 100 * nsac) a a. f op is the mmc clock frequency the host is using for the read operation. 8 clock cycles n wr 1 - 8 clock cycles n ec 0 - 8 clock cycles n ds 0 - 8 clock cycles n br 1 1 8 clock cycles


▲Up To Search▲   

 
Price & Availability of MC2GH512NMCA-2SA00

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X